I often go between Xcode 6 and 7 and want to avoid build warnings like this.
Conflicting return type when implementing 'supportedInterfaceOrientations': 'UIInterfaceOrientationMask' (aka 'enum UIInterfaceOrientationMask') vs 'NSUInteger' (aka 'unsigned long')
I cannot use a type that will satisfy both versions of Xcode at the same time. Therefore, I was going to implement a preprocessor macro that had different values depending on the value of __IPHONE_9_0.
#ifdef __IPHONE_9_0
#define CompatibilityUserInterfaceMask UIInterfaceOrientationMask
#else
#define CompatibilityUserInterfaceMask NSUInteger
#endif
When I try to implement this, although I get a build error.
- (CompatibilityUserInterfaceMask)supportedInterfaceOrientations { ... }
Is this possible, or does anyone have other ideas to achieve the same result?
source
share