`pushNavigationItem:` on UINavigationBar is needlessly private

Originator:pncalvin
Number:rdar://12197592 Date Originated:8/29/2012
Status:Open Resolved:
Product:iOS SDK Product Version:5.1 / 6.0
Classification:Other Reproducible:Always
 
Summary:
UINavigationBar has a private method called `pushNavigationItem:`, which is an alternative to `pushNavigationItem:animated:`. UINavigationController sends `pushNavigationItem:` when pushing navigation items onto the stack, bypassing any custom functionality in `pushNavigationItem:animated:`. This makes it impossible to intelligently change the behavior of a UINavigationBar without completely reimplementing `drawRect:`.

Steps to Reproduce:
1. Define `pushNavigationItem:animated:` on a subclass of UINavigationBar with a logging statement or breakpoint.
2. Set up the subclass as the class of a UINavigationController's navigation bar in Interface Builder. 
3. Create a button that pushes another view controller onto the stack.
3. Run the program and press the button.

Expected Results:
Your custom implementation of `pushNavigationItem:animated:` should be called.

Actual Results:
Your custom implementation is not called. `pushNavigationItem:`, a private method, is called instead.

Regression:
iOS 5.1 and iOS 6.0.

Notes:

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!