viewWillAppear is called if navigationItem is set in viewDidLoad
| Originator: | stephan.diederich | ||
| Number: | rdar://12214613 | Date Originated: | |
| Status: | Resolved: | ||
| Product: | Developer Tools | Product Version: | iOS 6 beta 4 (10A5376e) |
| Classification: | Serious Bug | Reproducible: | Always |
Summary: If the appearance of UIBarButtonItems is adjusted via setTitleTextAttributes and a ViewController sets it's navigationItem's UIBarButtons in viewDidLoad, this adjustment triggers a call to viewWillAppear. The appearance adjustments dictionary must contain the following key-value pair: [UIFont boldSystemFontOfSize:0.f], UITextAttributeFont Steps to Reproduce: * customize appearance of UIBarButtonItem's titleTextAttributes but keep the default font size ([UIFont boldSystemFontOfSize:0.f], UITextAttributeFont) * set navigationItem's barbutton in viewDidLoad e.g. via self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:nil]; Expected Results: Setting the navigationItem should not call viewWillAppear before viewDidLoad finished. Actual Results: viewWillAppear is called during viewDidLoad Regression: Does not happen in 5.1.1 Notes: A sample project is available https://dl.dropbox.com/u/858897/iPhone/TestProjects/NaviationItemTriggersViewWillAppear.zip
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!
Have you had any success on this? On the Golden Master, I still have the problem discussed here (https://openradar.appspot.com/12067615) which seems related.
I set a navbar's title font characteristics in didFinishLaunching ... . The font size changes, but the label it is contained does not resize, leaving an indented title. If I leave the view and return, it looks right.