I have a view currently displayed by a UINavigationController. When the user changes a selection elsewhere, I need the currently displayed title displayed by the UINavigationController to change. Even though I change the title in the current view controller, I can't get the UINavigationController to refresh the title.
I've tried all sorts of things and have not been successful changing the title.
I am doing a [tableview reloadData] for the rest of the view, but that's not changing the title.
In the view controller being displayed, I've tried the following
self.title = @"New title";
I've tried various combinations of setNeedsDisplay, setNeedsLayout on both the self.view and self.navigationController.view.
Nothing has successfully changed the title on the nav bar.
Thanks
Try setting self.navigationItem.title
to the desired value.
I had forgotten that I was overriding titleView. So I didn't need to set the title, but change the titleView. Once I did that, its working fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With