方法 – 它仍然被拒绝?

我听说使用[UIDevice setOrientation:]可能是应用程序拒绝应用程序的原因。 有没有有关它的certificate信息?

这是正确的 – 当使用这个私有方法时,你的应用程序将被拒绝。 我们已经做到了,我们已经被拒绝了(我们find了解决办法)。

方法是给你关于设备物理方向的信息,没有任何编码会改变这个物理方向。 它是根据陀螺仪/加速度计设置的,所以告诉设备它的方向是没有意义的。

如果你想改变接口的方向,那么你应该看看UIViewControllercallback,它允许你定义:

  interfaceOrientation property – shouldAutorotateToInterfaceOrientation: + attemptRotationToDeviceOrientation – rotatingHeaderView – rotatingFooterView – willRotateToInterfaceOrientation:duration: – willAnimateRotationToInterfaceOrientation:duration: – didRotateFromInterfaceOrientation: 

目前(iOS 5)的定义是:

 @property (nonatomic, readonly) UIDeviceOrientation orientation 

所以,即使有setter( setOrientation:.orientation = ),它也会是私有的API,正如官方文档所说,它不存在。 而使用私人API将会被拒绝。

如果方法没有logging,请不要使用它。 使用未logging的方法将导致拒绝。 这与检查Apple文档一样简单。

在这种情况下,文档指出:

 @property (nonatomic, readonly) UIDeviceOrientation orientation 

用这个:

  • (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {return UIInterfaceOrientationPortrait; }