Skip to content

Instantly share code, notes, and snippets.

@temojin
Created February 22, 2013 08:04
Show Gist options
  • Save temojin/5011653 to your computer and use it in GitHub Desktop.
Save temojin/5011653 to your computer and use it in GitHub Desktop.
Debugging to find which property of the UINavigationBar to change the title of the back button text on the top nav bar. Refer context: http://stackoverflow.com/questions/7237826/how-to-change-uinavigationbar-back-button-text/15018046#15018046
- (void)viewWillAppear:(BOOL)animated
{
self.navigationItem.backBarButtonItem.title = @"foo";
self.navigationItem.leftBarButtonItem.title = @"fii";
[self.navigationController.navigationBar.items enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
UINavigationItem *item = (UINavigationItem *) obj;
NSLog(@" item: %@", item.title);
}];
NSLog(@"bar back item: %@", self.navigationController.navigationBar.backItem.title);
NSLog(@"bar top item: %@", self.navigationController.navigationBar.topItem.title);
NSLog(@" back button %@", self.navigationItem.backBarButtonItem.title);
NSLog(@" left button %@", self.navigationItem.leftBarButtonItem.title);
NSLog(@" navigationItem %@", self.navigationItem.title);
NSLog(@" self.title %@", self.title);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment