views:

759

answers:

3

According to apple my application has to be able to run in both portrait modes. How do I accomplish this with shouldAutorotateToInterfaceOrientation??

+3  A: 

Just return YES no matter what the interface orientation is. This will allow the system autorotate to the upside-down orientation.

If you don't want to support the landscape orientations, then return:

return UIInterfaceOrientationIsPortrait(interfaceOrientation);
KennyTM
I don't want the user to be able to play in landscape mode, it doesn't work right. I just want the two portrait modes
NextRev
@Next: See update.
KennyTM
+1  A: 

This code allows any orientation except landscape:

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation
{
    return (orientation != UIDeviceOrientationLandscapeLeft) &&
           (orientation != UIDeviceOrientationLandscapeRight);
}
progrmr
A: 

Thanks for your answer 'progrmr'.
At this time iPad 3.2 coding should use interfaceOrientation instead of just orientation.

Tom Sgro