【发布时间】:2015-10-09 02:35:25
【问题描述】:
我经常在 Xcode 6 和 7 之间切换,并且想要一种方法来避免像这样的构建警告。
实现中的返回类型冲突 'supportedInterfaceOrientations':'UIInterfaceOrientationMask'(又名 “枚举 UIInterfaceOrientationMask”)与“NSUInteger”(又名“无符号” 长')
我似乎无法使用同时满足两个 Xcode 版本的类型。所以我打算实现一个预处理器宏,它根据 __IPHONE_9_0 的值具有不同的值。
#ifdef __IPHONE_9_0
#define CompatibilityUserInterfaceMask UIInterfaceOrientationMask
#else
#define CompatibilityUserInterfaceMask NSUInteger
#endif
当我尝试实现这个时,虽然我得到一个构建错误。
- (CompatibilityUserInterfaceMask)supportedInterfaceOrientations { ... }
这可能吗,或者有人有其他想法来达到相同的结果吗?
【问题讨论】:
标签: ios objective-c xcode