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

5

13

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?

Oversubscribe answered 14/6, 2012 at 6:26 Comment(4)
If you try to use modal UITabBarController(upd. Yes you do), then see solution here. Official explanation why this happend here.Closegrained
@Closegrained I do not show the tabbar modally.Oversubscribe
Is you "Login screen" a NavigationController? All controllers,that must be "rootViewController",shouldn't be used as "modal".Closegrained
@Closegrained LoginScreen is a shown as a modal to tabbar controller. All other controllers added to tabbar controller are under navigation controller as rootViewControllers. On login i dismiss the login modal to show the tabbarsOversubscribe
C
15

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.

Chlamydate answered 18/8, 2013 at 8:49 Comment(1)
It seems tab bar controller could be used in nav controller in iOS8 but get the error in iOS7.Omen
D
7

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.

Denazify answered 19/1, 2014 at 16:31 Comment(0)
E
1

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.

Enright answered 14/6, 2012 at 6:41 Comment(9)
Where do i place this method.Oversubscribe
what my app exactly does is-I have a tabbar application. I init a tabbarcontroller in my appdelegate and add all my classes to the array of tabbarcontroller. Then i add a login screen in the front of the tabbar and after login i show the tabbar. My application opens in the landscape mode, but i get this warning. also I think because of this i am getting my keyboard size incorrect. on displaying the keyboard width and height in landscape mode it gives me width = 352 and height =1024 in ipad 3. I seems that the system does not know that it is currently in landscape mode. ThanksOversubscribe
Did you search all your source code for those deprecated methods?Enright
Yes. Actually these methods do not appear anywhere in my code.Oversubscribe
Since 6.0 at least willAnimateRotationToInterfaceOrientation:duration: also triggers this ... sometimes, i have two projects with just willAnimateRotationToInterfaceOrientation:duration: nothing else, one yields the notice, other doesn't, there must be cruft in the nib's causing it.Pennyroyal
@Pennyroyal Thanks for the info..Appreciate it.Oversubscribe
I just had this message appear for the first time after adding a UINavigationController to a Storyboard that previously didn't have one. I was targeting iOS 5.1 ... the message disappears once I changed deployment to target iOS 6.0.Kentigera
@Kentigera Still havent moved to iOS 6.0. Once done i shall update this...ThanksOversubscribe
Experienced the same as Brindy, targeting 7.0 on Xcode5 - except changing deployment target isn't an option.Chlamydate
M
0

ckeck your array declaration for tab bar ..possible mistake u done: I declared array oblects after assigning

tabBarController.viewControllers = tabControlArry;
[tabControlArry addObject:navCOntroller];
[tabControlArry addObject:navController1];

correct way:

[tabControlArry addObject:navCOntroller];
[tabControlArry addObject:navController1];
tabBarController.viewControllers = tabControlArry;
Merle answered 22/8, 2013 at 6:18 Comment(0)
B
0

This error message is related to TabBarController usage. You can expect this error when you don't make your tabBarController as the "root controller" for your app. So make your TabBarController as the root controller & this error will no more pester you.

Bifocal answered 12/12, 2014 at 12:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.