I have made an app targeted for iOS 5 and iOS 6, and for some reason it only rotates when using it on devices with iOS 6, wether on an iPhone or an iPad, and doesn't rotate on devices using iOS 5. My app is universal. Please help me resolve this problem! Thanks
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
return ((toInterfaceOrientation == UIInterfaceOrientationPortrait) || (toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown));
}
- (NSUInteger)supportedInterfaceOrientations
{
return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown);
}
overide these two methods in your all uiviewcontroller subclasses ...... this will work for ios 6 and earlier
iOS 5 and iOS 6 call different orientation and rotation delegates. In iOS 5, implement:
shouldAutorotateToInterfaceOrientation:, which is deprecated in iOS 6.
So, in iOS 6, make sure you set a root view controller, and implement:
shouldAutorotate:, supportedInterfaceOrientations and supportedInterfaceOrientationsForWindow:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With