I have a problem where a navigation bar suddenly appear after popViewController is called when SearchDisplayCotroller is still active.
I am implementing a simple tableview with searching capability. Above is my storyboard.
On the first view, i've implemented as per below. So, the navigation bar will be always hidden for the first view.
- (void) viewWillAppear:(BOOL)animated{
[self.navigationController setNavigationBarHidden:YES animated:NO];
}
Button press will push the next table view controller with the below code so that the navigation bar will be visible.
- (void) viewWillAppear:(BOOL)animated{
[self.navigationController setNavigationBarHidden:NO animated:NO];
}
Everything works fine until i implemented the below code.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self.navigationController popViewControllerAnimated:YES];
}
When popViewControllerAnimated:YES while the SearchDisplayController is still active, a weird white navigation bar appears and my viewWillAppear is unable to hide the bar. Is this a bug or is there any way to prevent this bar from appearing?
The gif below may also give you the idea what did happen. Thanks!
Try this