I have the following code for my universal app but I’m getting this weird log when I run the app. Everything seems to be working fine, however.
- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if (NSClassFromString(@"UISplitViewController") != nil && UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
return YES;
}
else
return NO;
}
In the console:
The view controller <UINavigationController: 0x1468d0> returned NO from -shouldAutorotateToInterfaceOrientation: for all interface orientations. It should support at least one orientation.
The message says everything:
In your
elsestatement,NOis returned independently of the orientation. IfNOhere means “portrait only”, do the check and returnYESfor portrait:Or the more succinct (but less fancier) version: