This error doesn\'t make sense, as the preferred orientation UIInterfaceOrientationLandscapeRight
is returned by the supported orientation
//iOS
supportedInterfaceOrientations is only called, if shouldAutorotate is set to YES
- (BOOL)shouldAutorotate
{
return YES;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscape;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeRight;
}
The easiest approach for me, is only to set the Info.plist
If you like to support iOS 5 use this code in your view controllers.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}