不正确的iPhone方向?

我不明白为什么这不起作用。 我正在写一个游戏,涉及在屏幕上滚动块/列的块。 我将自己的方向严格限制在肖像上,但是并不如此。

当我调用下面的方法时,它是从锅里传递的速度。 使用日志,我能够看到,我的设备颠倒和平移作用就好像我的方向支持肖像。 我怎样才能完全closures除肖像以外的任何东西?

这里有一些代码来帮助解释我想做什么,并希望certificate我的理智。

bool horizontalPan = (fabs(velocity.x) >= (fabs(velocity.y))); if (horizontalPan) { if (fabs(velocity.x) > MAX_VELOCITY) { if (velocity.x > 0) velocity = CGPointMake(MAX_VELOCITY, 0); else velocity = CGPointMake(-MAX_VELOCITY, 0); } else { velocity = CGPointMake(velocity.x, 0); } velocity = ccpMult(velocity, PAN_SENSITIVITY); [self panRow:velocity object:object]; } else { if (fabs(velocity.y) > MAX_VELOCITY) { if (velocity.y > 0) velocity = CGPointMake(0, MAX_VELOCITY); else velocity = CGPointMake(0, -MAX_VELOCITY); } else { velocity = CGPointMake(0, velocity.y); } velocity = ccpMult(velocity, PAN_SENSITIVITY); [self panColumn:velocity object:object]; } } 

你是如何严格限制肖像的?

 -(BOOL)shouldAutorotate{ return NO; }