2
votes

I am having a Universal Project in iOS and that was working fine in all of the orientation but in iOS 6.0

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation

Method is not calling any more.

Even the other methods are not working.

Suggest me some fast solutions.

2

2 Answers

0
votes

Add this method to your view controller:

- (BOOL) shouldAutorotate {
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
        return YES;
    } else {
        return NO;
    }
}

This solved it for me. However, I shouldn't have had to do that as far as the iOS 6 release notes say:

"For compatibility, view controllers that still implement the shouldAutorotateToInterfaceOrientation: method do not get the new autorotation behaviors. (In other words, they do not fall back to using the app, app delegate, or Info.plist file to determine the supported orientations.)".

iOS 6 Release Notes

0
votes

You have to override - (NSUInteger)supportedInterfaceOrientations and - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation instead. Read the Apple Documentation, or watch Sessions from 2012 WWDC.