Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two-stage rotation animation is deprecated. This application should use the smoother single-stage animation

I am building a ipad application. when the applications starts i show it in landscape Right mode. But as soon as the application starts I get this message

Two-stage rotation animation is deprecated. This application should use the smoother single-stage animation

I used this method in all my classes

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}

I also set my supported interface orientations (iPad) to landscape right in my plist file. How to resolve this warning message?

like image 450
southpark Avatar asked Jun 14 '12 06:06

southpark


3 Answers

I just realized - after reading this answer - that I was simply using the Tab Bar Controller wrong: the tab bar should only be used as a root controller, however I inserted a navigation controller before it.

like image 76
Johan Avatar answered Nov 03 '22 06:11

Johan


You can also get this error message if you've run the app with an empty tab bar controller as root in your storyboard. I was just starting on an app and my UITabBarController has no view controllers yet, but is presenting a login modal.

like image 35
MLQ Avatar answered Nov 03 '22 06:11

MLQ


The problem is that your app is using one of these methods, which were deprecated in iOS 5.0:

didAnimateFirstHalfOfRotationToInterfaceOrientation:
willAnimateFirstHalfOfRotationToInterfaceOrientation:duration:
willAnimateSecondHalfOfRotationFromInterfaceOrientation:duration:

You need to modify your view controllers to override willAnimateRotationToInterfaceOrientation:duration: instead, and to not override any of the "HalfOfRotation" methods.

like image 1
rob mayoff Avatar answered Nov 03 '22 08:11

rob mayoff