My UIViewController calls a function on my rootViewController which then called popToRootViewControllerAnimated to return the view to the rootController. This all works – great!
Unfortunately the UINavigationItem (toolbar at the top) seems to display a mashup of both the rootViewController and the UIViewController that has just been removed.
What do I need to do? What have I done wrong?
The navigation bar doesn’t remember changes that were made to it, so when you push a new controller, the navigation bar is altered to give the title of the new view controller, but it doesn’t store what was there for the previous view controller.
You will need to recreate the items in the toolbar each time you come back to the view controller that has custom items.
You might be able to do this on
viewWillAppearinstead ofviewDidLoad. I can’t recall exactly, but you should recreate custom controls on navigation toolbar because it does not get preserved when a new view controller is pushed.