IOS6 Autorotation when moving from support orientation to unsupported table of contents

Like every iOS developer, now comes the time when autorotationg functions change when iOS6 starts iOS6 , given that I have one problem:

How my application supports UIInterfaceOrientationMaskPortrait , but for several view controllers I want to support all UIInterfaceOrientationMaskPortraitAll i by implementing it as follows:

in my rootviewcontrller, which in my case is navigation contrller:

 - (BOOL)shouldAutorotate { return self.topViewController.shouldAutorotate; //you are asking your current controller what it should do } 

in my view:

 -(BOOL)shouldAutorotate { return //if view supports auto orientation then return yes else no } 

everything works well, but one problem ... suppose my second view supports all orientations, and the 1st view only supports the portrait, and then if I rotate the 2nd view and return if my current view orientation (view2) is a landscape, then view1 will also not rotate to a supported orientation.

so as to overcome this problem, please if any solutions are welcome.

+4
source share
1 answer

Try resetting the orientation of your view in the viewDidLoad method. Solved this in my case.

0
source

All Articles