1

I have to support down to iOS 4.3.

My app outputs in the console :

Using two-stage rotation animation. To use the smoother single-stage animation, this application must remove two-stage method implementations.

As far as I know I'm not using two-staged rotation. I just have this method in my view controllers :

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

What else should I check in order to fix that?

Edit: More precisions: my app uses a UITabbarController subclass. When the app starts, it checks if a user is logged in and then initiates the controllers of the tabbar controller if it's the case. If there's no user logged in, a modal view is presented (from the tabbar controller) the prompt the user to login and the controllers of the tabbar controller aren't initialized (yet). The "two-staged rotation" error is shown only at that moment and the rotation doesn't work.

So to summarize, the problem happens in that situation:

  • The rootViewController of the main window is the tabbar controller
  • The tabbar controller is empty (there are no view controller in the tabs and there's no tab)
  • A view controller is modally presented from the tabbar controller
4

2 回答 2

0

OK I found a solution.

It seems like the presented modal view won't rotate until the viewControllers property of the UITabBarController is initialized. Since the concerned modal view is actually for login, I don't want to display anything behind it until the user is logged in because the views intended to be hold by the tabbar controller depend on the fact that a user is logged in. So now just before presenting the modal view, I initialize the tabbar controller with a single, empty UIViewController and I remove it when the modal view is dismissed (i.e. a user logged in).

Perhaps it seems like a hack but it works well. And even if I don't understand why, it doesn't seem completely illogical that the tabbar controller doesn't behave like we want until it is fully initialized.

If someone has a better solution or explanation, feel free to comment :)

于 2013-01-23T06:36:04.783 回答
0

There aren't many posts regarding this error, so I'll admit my own shortcomings for the benefit of the next person so focused on the trees they might miss the forest. I found a missing

[super viewWillAppear:animated];

call inside my sub.

于 2013-10-14T23:12:37.953 回答