UISeachDisplayController's UISearchBar incorrect after modal view goes Landscape

Originator:patrick.mccarron
Number:rdar://7478456 Date Originated:12/16/2009
Status:Open Resolved:
Product:iPhone SDK Product Version:3.2.1 10M2003
Classification:UI/Usability Reproducible:Always
 
NOTE: Pictures and Sample Code can be found at the following URL:
http://dl.dropbox.com/u/402467/TableSearchBug.zip

Summary: 
Take a portrait only application that has a UISeachDisplayController with UISearchBar scope buttons in it's heirarchy. Start a search, go a few levels up in the heirarchy. From there open a modal UIViewController subclass that allows orientation changes for Landscape. With that view open, rotate to Landscape atleast once and then close it out and return Back down the heirarchy to the UIViewController class. For some reason the UISearchBar's thinking it's in a Landscape draw mode still when it draws it's scope buttons and search box. (Attached: Image 5)

Steps to Reproduce:
1. Start a UINavigationController heirarchy with a UISearchDisplayControllerDelegate class.
2. Initiate a search. (Attached: Image 1)
3. Open a search results (Attached: Image 2)
4. Open a "rotatable UIViewController subclass" modally (Attached: Image 3)
5. Rotate the "rotatable UIViewController subclass" (Attached: Image 4)
6. (optional step) Rotate the "rotatable UIViewController subclass" back to Portrait
7. Close the "rotatable UIViewController subclass" by calling dismissModalViewControllerAnimated
8. Go "Back" to the UISearchDisplayControllerDelegate class

Expected Results:
I would expect the orientation changing of another viewcontroller, modal or otherwise, would not effect that of the UISeachDisplayController's UISearchBar and it would look as it looked before I left that view. (Attached: Image 1)

Actual Results:
For some reason the UISearchBar's not sure if it's a Landscape or Portrait draw mode still when it draws it's scope buttons and search box. (Attached: Image 5)

Regression:
Seems to happen in all current versions of the iPhone OS. But I have developed a few lines of code to correct this issue in the UISearchDisplayControllerDelegate class.  I do a [searchDisplayController setActive:NO animated:NO] followed by a [searchDisplayController setActive:YES animated:NO] along with other search option restoration changes required in the viewWillDisplay: method in order to get the UISearchBar to redraw itself properly before being displayed. 

Notes:
I've attached a sample project, called TableSearchBug based heavily on Apple's TableSearch example. By setting the kFixTabBarView constant to YES it will enable my code changes to cause the problem not to happen.  

I also attached five pictures, all noted above in the text, which are all zipped up along with the project code at this URL: http://dl.dropbox.com/u/402467/TableSearchBug.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!