I have a UISearchDisplayController
setup with a UITableViewController
which is nested inside a UINavigationController
. When a selection of a cell is made, UITableView's
didSelectRowAtIndexPath
method is triggered, which pushes a new view to the parent navigation controller. This new view should have the navigation bar hidden on entry.
[[self navigationController] setNavigationBarHidden:YES animated:NO];
I use this line in the didSelectRowAtIndexPath
method to hide the navigation bar. This works fine when a row is selected not using the search controller, but is overridden when selecting a search result. It seems the UISearchDisplayController
takes it in its right to un-hide the navigationBar sometime after the row is selected.
If I move the setNavigationBarHidden
call into the target view's viewWillAppear
method, results are similar. I can make it work by placing the hide call in viewDidAppear
, but this makes for a very awkward transition effect which feels jumpy and out of place. I would like to make the navigationBar already hidden before the new view slides on to the screen.
Does anyone know where the unhiding of the navigationBar is occurring, and/or any way I can override this behaviour?