In my view controller, I implement two methods for controlling interface orientation:
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOr
Two points:
Your error message makes complete sense because it makes no sense to use UIInterfaceOrientationPortrait as a return value from supportedInterfaceOrientations, which is returning a bit mask. Use one of the UIInterfaceOrientationMask values.
You seem to be concerned that if you use the proper UIInterfaceOrientationMaskPortrait, that iOS doesn't appear to call shouldAutorotate. It may only call shouldAutorotate if, having considered the physical device's physical orientation and the app's current orientation against the supportedInterfaceOrientations that a rotation might be needed. Why should it check shouldAutorotate if it concludes that the device is in an acceptable orientation already?
See supportedInterfaceOrientations and Handling View Rotations for more information.