I have a UIViewController (let's call it VC0) in a UINavigationController. VC0 makes use of a UISearchDisplayController to display results in a UITableView from a search. After the user selects a table cell from the search results, it pushes another UIViewController (call it VC1).
In both VC0 and VC1, I have set navigationBarHidden to YES. However, when I select the table cell and VC1 is pushed, I still see the navigation bar on top of VC1 with a back button to VC0.
How do I permanently hide the navigation bar in VC1?
Update:
The navigation bar disappears if I put the following line in viewDidAppear:, but it is still visible before it is hidden.
self.navigationController.navigationBarHidden = YES;
But if I put it in viewDidLoad or viewWillAppear:, it doesn't work. Any reason why?
[self.navigationController pushViewController:VC1 animated:YES];- Sudeep