Question

I'm running on Mt Lion with Xcode 4.5.1 installed.

By default, when I build and deploy to a iOS 5.1 device, the display would rotate when I rotate the device but it doesn't seems to work when I deploy to either the iOS 6 simulator or my iPad or iPhone running iOS 6.

Is there something I'm missing here?

Was it helpful?

Solution

Please read the following, hope it help. (referencehttp://developer.apple.com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.html)

Handling View Rotations

In iOS 6, your app supports the interface orientations defined in your app’s Info.plist file. A view controller can override the supportedInterfaceOrientations method to limit the list of supported orientations. Generally, the system calls this method only on the root view controller of the window or a view controller presented to fill the entire screen; child view controllers use the portion of the window provided for them by their parent view controller and no longer participate in directly in decisions about what rotations are supported. The intersection of the app’s orientation mask and the view controller’s orientation mask is used to determine which orientations a view controller can be rotated into.

You can override the preferredInterfaceOrientationForPresentation for a view controller that is intended to be presented full screen in a specific orientation.

In iOS 5 and earlier, the UIViewController class displays views in portrait mode only. To support additional orientations, you must override the shouldAutorotateToInterfaceOrientation: method and return YES for any orientations your subclass supports. If the autoresizing properties of your views are configured correctly, that may be all you have to do. However, the UIViewController class provides additional hooks for you to implement additional behaviors as needed. Generally, if your view controller is intended to be used as a child view controller, it should support all interface orientations.

and this link may be helpful for you http://www.cocos2d-iphone.org/forum/topic/40721 there are some interesting comment from the link above -> Try to override the shouldAutoRotate method on the rvc, and put the conditional there. As far as I have tested, the shouldAutoRotateToInterfaceOrientation isn't called on iOS6 even with all fixes applied, so I was forced to override several more methods.

please give me a feedback, thanks :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top