Since iOS6, I realize that the shouldAutorotateToInterfaceOrientation:
method has been deprecated. Most of my app I would like the user to be able to rotate, which does work in iOS6 and 5 currently. But, I have a modal view that I ONLY want to be portrait
, so I have added the following without it actually working (tested in simulator and device):
// Tell the system what we support
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationPortrait;
}
// Tell the system It should autorotate
- (BOOL) shouldAutorotate {
return NO;
}
// Tell the system which initial orientation we want to have
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationPortrait;
}
Why isn't this code preventing my modal from rotating? How can I still support the iOS5 method as well as the iOS6 methods without crashing for users on iOS5?