This is Probably happening because Apple Has changed the Way of managing the Orientation of UIViewController.
In Ios6 Oreintation handles Differently, in iOS6 shouldAutorotateToInterfaceOrientation
method has deprecated.iOS containers (such as UINavigationController
) do not consult their children to determine whether they should autorotate. By default, an app and a view controller’s supported interface orientations are set to UIInterfaceOrientationMaskAll
for the iPad idiom and UIInterfaceOrientationMaskAllButUpsideDown
for the iPhone idiom.
For More Information regarding the same You should visit this link
Below I have made the Category for handling the Orientation Change.
SO You will have to implement the Two more methods for managing the Orientation of UIViewController in iOS6.
Introduced In IOS6 Allow Orientation Change
- (BOOL)shouldAutorotate
{
return YES;
}
Return the Number of Oreintation going to supported in device
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
}
Now check what orientation you are getting.
EDIT: Place this Code to your FirstViewController added as root ViewController .this will help the UIViewController to determine it's Orientation.
@implementation UINavigationController (RotationIn_IOS6)
-(BOOL)shouldAutorotate
{
return [[self.viewControllers lastObject] shouldAutorotate];
}
-(NSUInteger)supportedInterfaceOrientations
{
return [[self.viewControllers lastObject] supportedInterfaceOrientations];
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation];
}
@end
I hope i'll be helpful to you.