What are single-state and two-stage animation for rotating an iPhone window?
This is the \"error\" message I get in the Debugger Console (nothing crashes):
Ed Marty's answer is the correct one. The reason it will happen if you are not overriding any of the rotation animation is probably that you reply "YES" to shouldAutorotate.. for some view. If you do not implement rotation at all, then you should just not override the shouldAutorotate.. method. If you do override that method, then just override the single step rotation method as well and pass it along to the super.
I've delete from plist "Supported interface orientations" row and warning disappears.
@plumiscles answer didn't quite work for me - there was no item called 'Supported Interface Orientations', probably b/c it is an old project. But you can get the same effect by editing the .plist file directly and adding this:
<key>UIInterfaceOrientation</key>
<string>UIInterfaceOrientationPortrait</string>
Everything is explained in the UIViewController Class Reference. Especially check out the View Rotation section near the top.
From the reference:
Handling View Rotations
By default, the UIViewController class displays views in portrait mode only. To support additional orientations, you must override the
shouldAutorotateToInterfaceOrientation:
method and return YES for any orientations your subclass supports. If the autoresizing properties of your views are configured correctly, that may be all you have to do. However, the UIViewController class provides additional hooks for you to implement additional behaviors as needed.To temporarily turn off features that are not needed or might otherwise cause problems during the orientation change, you can override the
willRotateToInterfaceOrientation:duration:
method and perform the needed actions there. You can then override thedidRotateFromInterfaceOrientation:
method and use it to reenable those features once the orientation change is complete.If you want to perform custom animations during an orientation change, you can do so in one of two ways. Orientation changes used to occur in two steps, with notifications occurring at the beginning, middle, and end points of the rotation. However, in iPhone OS 3.0, support was added for performing orientation changes in one step. Using a one-step orientation change tends to be faster than the older two-step process and is generally recommended for any new code.
To add animations for a one-step orientation change, override the
willAnimateRotationToInterfaceOrientation:duration:
method and perform your animations there. To use the older two-step method, override one or both of thewillAnimateFirstHalfOfRotationToInterfaceOrientation:duration:
andwillAnimateSecondHalfOfRotationFromInterfaceOrientation:duration:
methods to configure your animations before each step. You must choose only one technique and override just the methods associated with that technique. If you override either method associated with the two-step technique, the view controller uses that technique by default.
I just had the same problem. In my case was a silly mistake that I'm putting here just in case anyone else falls into that same issue.
In my tabbed app I remove one of the original ViewControllers and added a new one with Storyboard to create a "Settings" section.
This new VC had to be a table view VC and even I designed, compiled and run it without a problem, when I changed the orientation of the app I kept getting this “Using two-stage rotation animation” error.
My problem was that I forgot to change in the original .h file interface "UIViewController" for "UITableViewController".
Once this was done I changed on the Storyboard identity badge the class from the general value to my SettingsViewController and that was the end of it.
I hope it can help someone else. It took me a while to get to bottom of this.
Cheers,