View controller view lifecycle forwarding bug on iOS 5

Originator:defagos
Number:rdar://10822029 Date Originated:07-Feb-2012
Status:Closed Resolved:
Product:iPad SDK Product Version:5.0
Classification:Severe bug Reproducible:Always
 
07-Feb-2012 09:43 PM Samuel Defago:
Summary:

If the root view controller of an application is a custom view controller container (implemented *without* using the new iOS 5 API, i.e. by having -automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers return NO) or if the container is displayed modally, the view lifecycle events viewWillAppear: and viewDidAppear: are still forwarded to all its child view controllers, even those which are not supposed to receive them (most notably preloaded hidden view controllers). This should not be the case.

Steps to Reproduce:
Checkout the workspace at git://github.com/defagos/radars.git, and open the ios5-root-container-bug project. Build and run it with the iOS 4.3 SDK, check the logs. Do the same with the iOS 5 SDK, and compare the results. Read my thorough analysis in ContainerViewController.h for more information about this issue.

Expected Results:
Visible child view controllers receive single viewWillAppear: and viewDidAppear: events, those forwarded by the container implementation (since -automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers is implemented to return NO). Invisible child view controllers receive no such events

Actual Results:
Invisible child view controllers receive viewWillAppear: and viewDidDisappear: events. Visible child view controllers also receive such events, which means they receive them twice (along with those explicitly forwarded by the container implementation)

Regression:
Everything works as expected on iOS 4.3, but not on iOS 5 anymore


17-Feb-2012 04:23 PM Samuel Defago:
This issue was not a UIKit bug. The view controller documentation is clearly lacking details about how existing pre-iOS 5 container implementations must be updated for iOS 5, though. I filed a documentation improvement request (Problem ID 10884377)

This issue has been verified as resolved and can be closed.

Comments


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!