升级到 Xcode 7.0 后,我在 UIViewControllerRotation 方法中收到警告:- (NSUInteger)supportedInterfaceOrientations
:
Conflicting return type in implementation of 'supportedInterfaceOrientations': 'UIInterfaceOrientationMask' (aka 'enum UIInterfaceOrientationMask') vs 'NSUInteger' (aka 'unsigned int')
为什么会这样,我该如何解决?
编辑:
如果你去定义你会看到返回类型实际上已经改变了:
- (UIInterfaceOrientationMask)supportedInterfaceOrientations NS_AVAILABLE_IOS(6_0);
但更改代码中的返回类型不会使警告静音。
最佳答案
试试这个调整:
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
- (NSUInteger)supportedInterfaceOrientations
#else
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
#endif
{
return UIInterfaceOrientationMaskPortrait;
}
关于ios - 'supportedInterfaceOrientations' : - Warning 实现中的返回类型冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32699286/