Tab Bar Controller can block single-stage rotation animation messages

Originator:jdandrea
Number:rdar://7139857 Date Originated:13-Aug-2009 09:20 AM
Status:Open Resolved:9-Sep-2009 00:00 AM
Product:iPhone SDK Product Version:3.0 (7A341)
Classification:Serious Bug Reproducible:Always
 
Summary:

View controllers already on a Navigation Controller stack do not receive willAnimateRotationToInterfaceOrientation:duration: messages when a Tab Bar Controller's "More Navigation Controller" is in use.

Steps to Reproduce:

A minimal test case app was provided to Apple. Source is available upon request. (Email this report's originator name at gmail dot com.)

Here are the high level steps to reproduce:

1. Create a Tab Bar-based application, then launch Interface Builder.
2. In MainView.xib, remove the second view controller item.
3. Change the remaining View Controller to a "Navigation Controller" class.
4. A Navigation Controller object will be created, containing a Navigation Bar, a View Controller, and a Tab Bar Item.
5. Set the view controller to the FirstViewController class.
6. Add a View to the view controller.
7. Duplicate the navigation controller five more times. This forces a "More" tab bar item at run-time.
8. Back in Xcode, in FirstViewController, enable shouldAutorotateToInterfaceOrientation: and return YES.
9. Also in FirstViewController, enable willAnimateRotationToInterfaceOrientation:duration:, add a return statement, and place a breakpoint on it.
10. Compile and run.
11. Rotate the device for any visible tab bar item, then for either tab bar item within the "More" hierarchy. Observe when the breakpoint is and isn't reached after a rotation.

Expected Results:

Each time the device is rotated, the breakpoint should be reached, no matter which tab bar item is selected, even if we are within the "More" hierarchy.

Actual Results:

Only when in the "More" hierarchy, willAnimateRotationToInterfaceOrientation:duration: is NOT called, and the breakpoint not reached.

Also, in the debugger console, when rotating the device with the "More" hierarchy in play, this message is displayed: "Using two-stage rotation animation. To use the smoother single-stage animation, this application must remove two-stage method implementations."

Regression:

None known.

Notes:

This problem does not occur when the tab bar item view controllers are basic view controllers. Only when they are navigation controllers and only when the "More" navigation hierarchy is in use.

The console message (regarding two-stage rotation animation) suggests that something within the framework (the More Navigation Controller?) is still using a two-stage animation, even though single stage is now recommended as of iPhone OS 3.0.

That could explain why willAnimateRotationToInterfaceOrientation: is not called in that particular case. Per Apple's view controler documentation, this message will NOT be invoked when two-stage, first/second-half orientation messages are being responded to instead.

Comments

Fixed in 3.1? I think so!

It appears as if this is fixed in the 3.1 release (9 September 2009)! Great news.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!