Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dynamically set navigation controller title [closed]

I'm working with core data, and part of my app is very very similar to the default contacts app. There is an edit screen after a contact is in core data, and I would like to make the title: [insert contact name here] s information". I know I can set the title to just the core data entity attribute by doing: self.navigationController.title = _athletesFullName; (property for attribute under the entity "Athlete"). Is there any way I can do something like

self.navigationController.title = @"%@'s information",_athletesFullName; ?
like image 322
Josue Espinosa Avatar asked Aug 10 '13 11:08

Josue Espinosa


2 Answers

try this code:

 self.navigationController.navigationItem.title=[NSString stringWithFormat:@"%@ 's information",_athletesFullName];
like image 136
kirti Chavda Avatar answered Oct 27 '22 00:10

kirti Chavda


self.navigationItem setTiltle: is the normal way. The navigationItem is added by interface builder is you embed your viewcontroller in a navigationController.

like image 34
Rob van der Veer Avatar answered Oct 26 '22 23:10

Rob van der Veer