2016-04-27

Warning about supportedInterfaceOrientations

Your iOS project might get warning supportedInterfaceOrientations on Xcode 7.0. The cause is just building for iOS 9.
Conflicting return type in implementation of 'supportedInterfaceOrientations': 'UIInterfaceOrientationMask' (aka 'enum UIInterfaceOrientationMask') vs 'NSUInteger' (aka 'unsigned long')

What should I do?

Change return type for after iOS 9
- (NSUInteger)supportedInterfaceOrientations
    
- (UIInterfaceOrientationMask)supportedInterfaceOrientations

This is useful coding if the project contain under iOS 9
  1. #if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
  2. - (NSUInteger)supportedInterfaceOrientations
  3. #else
  4. - (UIInterfaceOrientationMask)supportedInterfaceOrientations
  5. #endif
  6. {
  7.    return UIInterfaceOrientationMaskPortrait;
  8. }

Ref Link

http://stackoverflow.com/questions/32699286