1
votes

My app should only support Portrait mode but in one single view controller I want to be able to use landscape. If I set supported device orientations in project to Portrait only and run the app < iOS6.0 it works fine, but with iOS6 it crashes with: 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES.

Turning landscape on in project properties will always rotate all other viewcontrollers even if I use shouldAutorotate (iOS6) or shouldAutorotateToInterfaceOrientation (pre iOS6).

Any ideas?

1

1 Answers

3
votes

Got it. Used this

Enabled portrait and landscape orientation in project settings, used category in app delegate and override

- (NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscape;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}

in my landscape viewcontroller