When I tried to type the method “shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)x” XCODE told me that method had been deprecated and that I should use “supportedInterfaceOrientations” and “preferredInterfaceOrientationForPresentation.” Looking up autorotation in the documentation, it said to use the deprecated method. Seems the documentation is not up to date with XCODE. Can anyone help me figure out how to use the two new methods? I haven’t a clue.


Looks like you are using a newer version of Xcode.
See the UIViewController Class Reference in iOS Developer Library at:

You should also read the Companion guides:
View Controller Programming Guide for iOS
View Controller Catalog for iOS


The link you provided supported my statement that the book’s code was out of date. The latest version of XCode, which I have, says the book’s method has been deprecated in iOS 6 and the two new methods I mentioned in my first post were the way to go. Can anyone help me figure out how to use these two new methods?


How to use them is explained in the section Supporting Multiple Interface Orientations in the View Controller Programming Guide for iOS:



Here’s the code I used in HeavyViewController.m:

return YES;

return UIInterfaceOrientationMaskAllButUpsideDown;
As far as I understand it, the first method specifies whether or not the view should rotate at all, and the second method specifies the allowable interface orientations.


Thanks guys! Your help got me through the issue.