Back button without custom images inherits images from back button it replaces

Originator:wcmiii
Number:rdar://11275920 Date Originated:4/18/2012
Status:Closed Resolved:6/25/2012
Product:iPhone SDK Product Version:5.1 (9B176)
Classification:Other Bug Reproducible:Always
 
Summary:
When replacing the back bar button item of a view controller from a view controller more recently pushed onto the navigation stack, the replacement bar button item draws with the custom background images of the back bar button item it replaced.

Steps to Reproduce:
Present a "primary" view controller in a navigation controller.
Configure the primary view controller's navigationItem with a backBarButtonItem that has custom background images.
Push a "detail" view controller onto the navigation stack.
In the viewWillAppear: method of the detail view controller, assign a new bar button item with a title to the backBarButtonItem property of the primary view controller onto which the current detail controller was pushed. The new bar button item has no custom background images assigned and is not an instance of a subclass that provides custom background images.

Expected Results:
The back bar button item is drawn with stock background images, according to the current style or tintColor of the navigation bar.

Actual Results:
The back bar button item is drawn with the background images of the back bar button item it replaces, despite the fact that it does not provide custom background images itself.

Regression:
Introduced in iOS 5 with the UIAppearance APIs.

Notes:
A minimal project demonstrating the issue is attached.

Comments

Resolved: Fixed

Fixed in 6.0 beta 2 (10A5338d)

Download link for project file

http://dl.dropbox.com/u/13103695/BackButtonDemo.zip


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!