I am seeing a weird situation. I have put a search bar in the navigation bar and have linked a UISearchDisplayController with the search bar. Now, the search display controller tends to hide the navigation bar when the user clicks on the search bar (therefore, hiding the search bar also). In order to counter that, I subclassed UISearchDisplayController and implemented the following code :-
- (void)setActive:(BOOL)visible animated:(BOOL)animated
{
[super setActive: visible animated: animated];
[self.searchContentsController.navigationController setNavigationBarHidden: NO animated: NO];
}
Now, this fixed the original problem. I am able to search and navigate to other controllers.
However, lets say that I do a search on view controller A and then click on a search result which then pushes view controller B on the navigation stack. Now, if I pop the view controller B and return back to A, then my navigation bar disappears. It looks like that the search display controller is active and so it hides the navigation bar.
If I make the search display controller inactive and then push view controller B and then pop it, then the navigation bar appears.
So, is there any way that my search display controller can remain active and the navigation bar does not disappear when I pop view controller B from navigation stack ?
And I am targeting iOS6
(It is a very long code so not sure what I should post here).