Conflicting return type in implementation of 'supportedInterfaceOrientations': - Warning
Try this tweak:
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
- (NSUInteger)supportedInterfaceOrientations
#else
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
#endif
{
return UIInterfaceOrientationMaskPortrait;
}
Xcode 7: Conflicting return type in implementation of 'supportedInterfaceOrientations': 'UIInterfaceOrientationMask' vs 'NSUInteger'
This is how I solved those problems:
1) Apple seems doesn't support anymore Retina 4. This means that iPhone 4*, iPhone 5* and iPhone 6 need to be placed inside the @2x box. Surely it's trickier to handle fullscreen images, therefore you have to handle all programmatically.
2) I fixed this issue by setting all of the images to "Universal" instead of specific device (iPhone 4S and 5. Don't know why but iPhone 6 worked even with specific device). Anyways, bug or not I've notified Apple.
3a) The return type of the method UIInterfaceOrientationMask
has changed, so if you get a warning such as ../ViewController.m:41:1: Conflicting return type in implementation of 'supportedInterfaceOrientations': 'UIInterfaceOrientationMask' (aka 'enum UIInterfaceOrientationMask') vs 'NSUInteger' (aka 'unsigned int')
you need to replace the return type.
// Before upgrading
- (NSUInteger)supportedInterfaceOrientations
{
...
}
// After upgrading
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
...
}
(Thanks to Rainer Schwarze)
3b) It seems the upgrade created issues in custom framework contexts (correct me if I'm wrong), this can be solved by removing the references from Build Settings.
Hope this could be helpful!
IOS/Objective-C: Conflicting return type in implementation error
You have likely defined myStatusLevel
in your @interface
with void
, rather than the method signature you've shared with us here.
supportedInterfaceOrientations not called with iOS 7
You should implement these code in your custom NavigationController.
- (NSUInteger)supportedInterfaceOrientations {
if ([self.topViewController isMemberOfClass:[RootViewController class]]){
return UIInterfaceOrientationMaskPortrait;
}else{
return UIInterfaceOrientationMaskAllButUpsideDown;
}
}
because when your device rotate, it will ask your app rootController(Custom NavigationController) first, if supportedInterfaceOrientations
is not implement there. then it will ask the rootController for supportedInterfaceOrientations
.
A view controller that acts as the root view controller of the main window or is presented full screen on the main window can declare what orientations it supports.View Controller Programming Guide
Related Topics
How to Make Uibutton's Text Alignment Center? Using Ib
Drawrect Circle and Animate Size/Color
iOS App, Programmatically Get Build Version
Change Bundle Identifier in Xcode When Submitting My First App in iOS
Uicollectionview's Cellforitematindexpath Is Not Being Called
Ios: Uiview Subclass Init or Initwithframe:
Presentviewcontroller and Displaying Navigation Bar
Color in Storyboard Not Matching Uicolor
How to Build .Ipa for React Native
Change the Color of iOS Navigation Bar
Making an Array of Integers in iOS
Saving PDF Files with Swift in iOS and Display Them
Cllocationmanager and Accuracy Issues - Any Experiences
Disable Scroll on a Uiwebview Allowed
Using iOS Gamekit's "Bluetooth Bonjour" with Other Platforms
Bringing a Subview to Be in Front of All Other Views