0

My code is working fine in iOS 5.1 but not in iOS 6. I am getting orientation problems.

I am using this code for controlling the orientations

-(BOOL)shouldAutorotate
{
    return YES;

}
-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscapeRight;
}

I want to show one view controller in Landscape mode and other viewController in Portrait mode

Any one can help me with this?

Thanks

The iOSDev
  • 5,237
  • 7
  • 41
  • 78
pratap shaik
  • 165
  • 1
  • 9
  • see my answer http://stackoverflow.com/questions/12600778/how-to-lock-orientation-in-uinavigationcontrollers/12601324#12601324 – Deepesh Oct 22 '12 at 05:20
  • i think you have to override this method: - (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window – kidsid49 Oct 22 '12 at 05:21
  • and see this answer http://stackoverflow.com/questions/12933089/i-want-to-make-my-appliaction-only-in-landscape-orientation-in-ios-both-ios-5-a – Deepesh Oct 22 '12 at 05:21

1 Answers1

1

Try look at this

iOS 6 Tips and Tricks Upgrading Your Apps

OR

try to add this codes in Main viewcontroller:

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {

return UIInterfaceOrientationLandscapeRight;

}

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)w {

return (NSUInteger)[application supportedInterfaceOrientationsForWindow:w] | (1<<UIInterfaceOrientationPortrait);

}

And main viewcontroller must be added how:

[window setRootViewController: mainController];

instead

[window addSubview: mainController.view];
CReaTuS
  • 2,593
  • 1
  • 19
  • 31