Reputation: 419
I know self.navigationItem.backBarButtonItem.title
is set for the next view controller;
In view Controller A: when I use
self.navigationItem.backBarButtonItem.title=@"back";
it does not work. However when
UIBarButtonItem *newBackButton=[[UIBarButtonItem alloc] initWithTitle:@"back" style:UIBarButtonItemStyleDone target:nil action:nil];
[[self navigationItem] setBackBarButtonItem:newBackButton];
it works successfully! Why…..
Upvotes: 0
Views: 1345
Reputation: 9346
The title of the back button is either:
If you are setting the back button for the current view controller's navigation item you are not setting the button that get's displayed in the current view. You are in fact setting the back button that will be used if you push another view controller from it.
Upvotes: 1