I set up XCode 4.5 and iOS6 simulator a few minutes ago. My app supports all 4 orientations of the iPhone, portrait bottom and top home button, landscape left and right.
Well, I put that to the .plist as it is required by iOS6 and also the old shouldRotateTo... method is still there returning YES.
But in the simulator, the App is not rotating to portrait top home button.
Why? Is this by purpose? Would it work correct on device?
Thanks.
I think your viewControllers are going to return the default which is all but upside down. You need to implement:
For all the viewControllers you want to support all orientations.
OK, I found the answer now myself.
It is not enough to have
in YOUR ViewController if it is pushed into a
UINavigationViewController
. TheUINavigationViewController
also has to have those methods. Preferably, you do this by having a small Category onUINavigationViewController
.This is my
UINavigationController-Rotation.h
:and my UINavigationController-Rotation.m:
Thanks for helping me!
In case anyone else who is still having issues even after following Christoh's answer:
I just noticed the projects plist has separate entries for iPad and iPhone (Supported Interface Orientations (iPad) and Supported Interface Orientations (iPhone)).
Hope that helps.
The default behavior for iOS6 on iPhone is no Upside-Down orientation.
from UIViewController Class Reference: The default values for a view controller’s supported interface orientations is set to UIInterfaceOrientationMaskAll for the iPad idiom and UIInterfaceOrientationMaskAllButUpsideDown for the iPhone idiom.
You can see this behavior also in Safari or Maps.
I tried to override this with UIInterfaceOrientationMaskAll, like Dean said, but to no effect. I decided not to use the upside down mode anymore, since it's kind of a User Interface Guideline thing which I like to follow and not to confuse users.