Reputation: 4594
I have this:
FirstViewController:
SecondViewController *secondViewController = [[SecondViewController alloc] init];
[self.navigationController pushViewController:secondViewController animated:YES];
SecondViewController:
- (void)viewDidLoad
{
[super viewDidLoad];
[self.navigationController setNavigationBarHidden:YES];
}
My problem is that when I comeback from SecondViewController to FirstViewController the NavigationBar is still hidden.Is there a way to make it appear when I'm back in FirstViewController?
Upvotes: 0
Views: 78
Reputation: 1579
You need to set [self.navigationController setNavigationBarHidden:NO]; This will do.
Upvotes: 1
Reputation: 26652
Yep, it's always possible that a different navigation controller will have set the bar to be hidden. So, in your viewWillAppear
set the flag as follows:
self.navigationController.navigationBarHidden = NO;
Upvotes: 1
Reputation: 8163
In the FirstViewController.m
:
-(void)viewWillAppear:(BOOL)animated
{
[self.navigationController setNavigationBarHidden:NO];
}
Upvotes: 1