In my app I have multiple views, some views need to support both portrait and landscape, while other views need to support portrait only. Thus, in the project summary, I have all selected all orientations.
The below code worked to disable landscape mode on a given view controller prior to iOS 6:
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
If your are using a UINavigationController as the root window controller, it will be its
supportedInterfaceOrientations which would be called.
Idem if you are using a UITabBarController, and so on.
So the thing to do is to subclass your navigation/tabbar controller and override its