My root view controller's implementation of supportedInterfaceOrientations
almost always returns UIInterfaceOrientationMaskAll
, however there is one edge case where it returns UIInterfaceOrientationMaskLandscape
.
This is working, if the user rotates the device. However if the device is being held in portrait mode the supportedInterfaceOrientations
method does not ever get called, unless the user manually rotates the device.
How can I programatically tell the system that the return value of this method has changed?
According to the documentation, it seems like I should be able to call [UIViewController attemptRotationToDeviceOrientation]
however this does not have any effect (supportedInterfaceOrientations
is never called and the screen does not rotate).
I found various workarounds others have posted to try and solve this problem, but none of them work in my tests. I suspect they may have worked in iOS 5.0, but not iOS 6.0.
I am returning YES
in the root view controller's shouldAutorotate
method.