Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Want to change NavigationItem title

I've embedded my first view into a NavigationController and then i set the segue as push. I want to change in each view the title of the Navigation bar to display something and update it through my code. i tried to call the navigation controller like this:

self.navigationController.navigationBar.topItem.title = @"YourTitle";

but this wont work, how can I do it?

like image 271
Eli Braginskiy Avatar asked May 28 '13 10:05

Eli Braginskiy


1 Answers

Navigation controller gets the title from the viewcontroller so this will do the job

- (void)viewDidLoad {

   [super viewDidLoad];
   self.title = @"Some Title";
}
like image 193
Lithu T.V Avatar answered Oct 02 '22 07:10

Lithu T.V