I have a complicated structure where I have a custom tab-bar controller that houses multiple navigation controllers. Some of these sub-navigation controllers only support portrait mode so I just turn off rotation when I get to them. When I come into the new navigation controller and it is in landscape is there a way to force auto-rotation to portrait at that time?
Apple is no longer allowing private method calls, they're running the apps through static analysis now when they're submitted. If you submit a new app using
[[UIDevice currentDevice] setOrientation:] it will be rejected.
You can try the undocumented method
setOrientation: from the
UIDevice class. Here is one example:
[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationPortrait];
You will have one compiler warning, ignore it.
I do not have problem with Apple rejection using this method, so until now it works.