using xcode 4.2 and iOS 5 and have nav bar on root controller and four other views (inc UITable view) all i want is to hide nav bar in first root view controller and show in all other views…
Tried following
[self.navigationController setNavigationBarHidden:YES animated:animated];
No luck any ideas?
Use this code in your root controller (or all of your view controllers that you want to have a hidden navigation bar. see [1] though) in order to hide/show the navigation bar according to what you are aiming at:
This is just a possible solution. You could well leave
viewWillDisappearundefined in your non-root controllers and defineviewWillAppearin your root controller… as you see it most convenient for you.[1] Hiding the navigation bar in anything but the root controller makes it possible to get stuck in the middle of your navigation hierarchy. Also it is against intuitive navigation in an iOS app to suddenly hide the navigation bar for anything else than the root view.)