0

Possible Duplicate:
shouldAutorotateToInterfaceOrientation doesn’t work

I am pushing a UIViewController into a UINavigationController after I call pushViewController the shouldAutoRotate method is getting called and it is getting into the iPhone. However, when I rotate the device this is no longer called. Why is this?

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    if (IS_IPHONE){
        return interfaceOrientation == UIInterfaceOrientationPortrait;
    } else {
        return YES;
    }
}

I want this UIViewController to be on portrait only. My viewWillLayoutSubviews is getting called though. To give more context the willAnimate methods is all getting called

Community
  • 1
  • 1
adit
  • 32,574
  • 72
  • 229
  • 373
  • Is this on iOS6? Looks like that method is deprecated. – aqua Oct 11 '12 at 22:03
  • maybe you have enabled only one orientation in "supported orientations" field in info.plist file? You should make list of available orientations in plist file, or add them in project settings (this automatically adds them to plist) – Alexander Tkachenko Oct 11 '12 at 23:06
  • this link might help http://developer.apple.com/library/ios/#qa/qa1688/_index.html – janusfidel Oct 12 '12 at 04:30

0 Answers0