3

只是一个快速的问题。假设我已将我的应用程序更新到 iOS6 并更改了 iOS5 的 shouldAutoRotate 方法,如下所示:

- (BOOL) shouldAutorotate
{
return YES;
}

-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeRight;
}

如果我仍然支持 iOS5,如果应用程序正在运行 iOS5 的设备上运行,我是否需要检查 iOS 版本,然后还包括旧的 iOS5 方法(即 shouldAutoRotateToInterfaceOrientation)?

谢谢 !

4

1 回答 1

5

可以在您的应用程序中同时包含 iOS5 和 iOS6 代码。

在 iOS5 上,supportedInterfaceOrientations 和 shouldAutorotate 不会被调用,而在 iOS6 上,旧方法 shouldRotateToInterfaceOrientation 等不会被调用。

于 2012-10-09T16:55:39.367 回答