I have a tab bar application with a different view on each tab. Each view has a UINavigationBar with title set on Interface Builder. I want to change the title based on a clause in the ViewDidLoad method, so if x { change the title }.
I have tried self.title = @"title"
, but this changes the title of the tab bar item itself.
So, how is this done?
Note that in order for the title to show up AT ALL the Navigation Controller's delegate MUST be set to the navigation bar itself or the title will NEVER show!
If the class is a type of UIViewController, then you can set title as given in the viewDidLoad method.
Use this :
or
In ViewDidLoad of your ViewController.m just write,
Here is the Output: