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.
我该怎么把导航器藏起来?