支持InterfaceOrientations iOS 8与iOS 9

时间:2015-09-21 11:16:08

标签: ios xcode xcode7

我更新到最新版本的XCode(7.0)后发生警告。

conflicting return type in implementation of 'supportedInterfaceOrientations': 'UIInterfaceOrientationMask' (aka 'enum UIInterfaceOrientationMask') vs 'NSUinteger' (aka 'unsigned long')

我猜这个

-(NSUinteger)supportedInterfaceOrientations
iOS 9中不再支持

,我尝试在其上搜索一些文档但我无法找到它。

那么未来最佳解决方案是什么?

1 个答案:

答案 0 :(得分:0)

我想我找到了一个可能的解决方案:

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 90000  
- (UIInterfaceOrientationMask)supportedInterfaceOrientations  
#else  
- (NSUInteger)supportedInterfaceOrientations  
#endif