i have an application build on xcode 4.2 , which supports only portrait orientation, it works fine with all devices except ios6 .. In Ios 6 devices it is showing both orientations .. I need only portrait orientation .. i am using navigation controller .. IN appdelegate::
- (BOOL)shouldAutorotate
{
return ([[UIDevice currentDevice] orientation]==UIInterfaceOrientationPortrait);
}
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
return (UIInterfaceOrientationMaskPortrait);
}
in other viewControllers ::
- (BOOL)shouldAutorotate {
return YES;
}
- (void)viewDidLayoutSubviews
{
DisplayFunctionName;
NSLog(@"orientation: %d",self.interfaceOrientation);
}
- (NSUInteger)supportedInterfaceOrientations
{
if (UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPad)
{
return (UIInterfaceOrientationMaskAll);
}
else
{
return (UIInterfaceOrientationMaskPortrait);
}
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
DisplayFunctionName;
NSLog(@"orientation: %d",interfaceOrientation);
return (interfaceOrientation==UIInterfaceOrientationPortrait);
}