Unexpected nil navigationController on viewWillDisappear:
| Originator: | jpedroso | ||
| Number: | rdar://7015734 | Date Originated: | 29-Jun-2009 04:51 PM |
| Status: | Open | Resolved: | No |
| Product: | iPhone SDK | Product Version: | 3.0 |
| Classification: | Other Bug | Reproducible: | Always |
Summary: Lets assume two UIViewControllers hierarchically managed by a UINavigatioController and both were pushed into the stack. Now, if the device orientation changes to landscape and the top view controller is popped, on viewWillDisappear: accessing the sefl.navigationController property will return a nil value. This is not the case when accessing self.navigationController if the orientation is portrait. Steps to Reproduce: 0. Using the NavBar sample code attached to this report, run the app in device or simulator; 1. Select View 1; 2. Rotate device or the simulator to landscape; 3. Hit the NavBar back button to pop the view controller. Expected Results: In Xcode's Console window, the last log entry, should display something like -[PageOneViewController viewWillDisappear:] - <UINavigationController: 0xd19230> indicating that the self.navigationController property isn't returning nil. Actual Results: In Xcode's Console window, the last log entry displays "[PageOneViewController viewWillDisappear:] - (null)" indicating that the self.navigationController property is returning nil. Regression: This is not the case when device orientation is portrait, so I'd expect the same to happen in landscape. Also, if I did not misunderstood the documentation, it backs up this behaviour by saying that the property returns the navigation controller as long as the view controller is in the stack. I guess one can assume the view controller is still in the stack at the time of viewWillDisappear:, as opposed to viewDidDisappear:. 'NavBar.zip' was successfully uploaded
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!