I am using iOS 5
and XCode 4.2
. After coding I gave support for landscape and portrait orientation. It is working correctly. But the orientation is not supported when I used the code in XCode 4.5
iOS 6
.
Do anyone know the reason?
I am using iOS 5
and XCode 4.2
. After coding I gave support for landscape and portrait orientation. It is working correctly. But the orientation is not supported when I used the code in XCode 4.5
iOS 6
.
Do anyone know the reason?
It correct way or not i don't know. But temporarily i used this method. If it useful you too can use.
You can write this method in your Appdelegate
.
-(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{
[navigationController.topViewController shouldAutorotate];
return UIInterfaceOrientationMaskAll;
}
You can write - (BOOL)shouldAutorotate
method in your viewController
.
Please check you project setting (Summary)
Supported Interface Orientation Setting for the allowed oreintations
OR
Try to lock the orientation using the following code: