I have setup in storyboard a navigation controller and a tableview controller. There is a search bar in the tableview.
I get a reference to the navigation controller using self.navigationcontroller.
I use
[self.navigationController setNavigationBarHidden:YES animated:animated];
To hide the navigation bar in the subsequent view which is displayed.
This works fine when selecting a cell in the tableview without using the searchbar.
However, if I use the searchbar to display specific cells in the table view and if I select a cell from that table, then apparently I lose the reference to the navigation controller because although the above code is executed, the navigation bar is still displayed in the follwing view.
What should I do to hide the navbar??
This is what I found: The NavigationBarHidden property is apparently reset because when the searchbar leaves the view, it will send the navigationbar again on the view. I am not sure I understand exactly what is happening, but this line of code in my viewWillDisappear solves the problem: