views:

141

answers:

2

So here's the functionality that I'm looking for:
1. Main Menu doesn't have the navigation Bar
2. All other screens from the Main Menu do.
3. It should animate correctly

I partially got this to work (just not the back button part).

In the Main Menu viewDidLoad I just go:

[self.navigationController setNavigationBarHidden:YES];

In another window (Screen1), in its viewDidLoad I go:

[self.navigationController setNavigationBarHidden:NO animated:YES];

So now, when I run the program. I have my own button in the main menu that when you click it, it transitions to Screen1, and the animation works properly: I.e., no bar in main menu but and as soon as I hit the button, Screen1 slides in with its Navigation Controller Bar. So far so good.

But here's the problem, when I click the "back" button to go back to my Main Menu from Screen1 it keeps the Navigation Controller Bar up there (i.e., it doesn't call the Main Menu's viewDidLoad) but I don't want a Bar in my main menu! Any ideas?

+2  A: 

Don't use viewDidLoad, use viewWillAppear: or viewDidAppear: (depending on which looks better for you). viewDidLoad is only called once, the first time the view loads.

Ian Henry
thank you, that did it (I used viewWillAppear in main menu to set the navigation bar to hidden)
Shnitzel
+1  A: 

What if you try hiding it in viewDidAppear instead of viewDidLoad?

bmoeskau