基于SDK版本的覆盖方法

时间:2015-09-04 13:35:34

标签: ios ios9

我在Xcode 7上测试我的应用程序,它给了我一个supportInterfaceOrientations方法的警告。在Xcode 7之前,此方法的返回类型是NSUInteger。现在是UIInterfaceOrientationMask。我能做些什么,以便它适用于以前的SDK以及新的SDK?我做过这样的事情:(我不确定这是否正确)

#ifdef __IPHONE_9_0
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
#else
- (NSUInteger)supportedInterfaceOrientations
#endif
{
    return UIInterfaceOrientationMaskAll;
}

0 个答案:

没有答案
相关问题