Reputation: 6871
My initial question is:
I want to change the navigation item (both title and button when switching between tabs).
I tried the answer : Storyboard navigation controller and tab bar controller. It says:
self.parentViewController.navigationItem setTitle:@"Title"];
add to viewDidLoad in each view controller works.
However, when I re-enter the view, the tile won't change. I think it means viewDidLoad won't get called-back when re-entering.
Any solution about Storyboard navigation controller and tab bar controller ?
Upvotes: 0
Views: 891
Reputation: 1734
It would be better to have a navigation controller for each tab in you tab bar. Then you can set your titles right in the storyboard.
Upvotes: 0
Reputation: 1217
You're looking for viewWillAppear:
. Here's Apple's documentation. This method will be called on the controller that is being presented, or being transitioned to. viewWillDisappear:
(documentation here) is called on the controller that is being transitioned away from.
Upvotes: 2