How-To: Change text on Back Button in UINavigationBar (UINavigationController)
Dec.31, 2008 in
Tech, iPhone Development
If you’re using a UINavigationController to control the navigation in your iPhone app, you’ll find that the “Back” button on your navigation stack can sometimes get very long – particularly if you have long titles for the views you push on to your UINavigationController stack.
That’s where changing the text on the ‘Back’ button can come in handy. The following code will change the text on the ‘Back’ button to show the text ‘Back’ instead of a shortened version of the previous view’s title:
self.navigationItem.backBarButtonItem =
[[UIBarButtonItem alloc] initWithTitle:@"Back"
style: UIBarButtonItemStyleBordered
target:nil
action:nil];

February 15th, 2009 at 2:07 pm
This is well and good. Do you know how to get the target and action to work, though? I’d like to put a small tweak in the Back button behaviour, but can’t seem to get it to call my code when I replace the target and action with something besides nil.
March 8th, 2009 at 9:29 am
I have a solution for this problem. Please read the description on my blog:
http://osmorphis.blogspot.com/2009/03/trapping-uinavigationbar-back-button.html
March 12th, 2009 at 11:54 pm
After some additional research (and comments from better experts) I have an alternative solution that may work even better. Please see part 2 of my article:
http://osmorphis.blogspot.com/2009/03/trapping-uinavigationbar-back-button_11.html
July 22nd, 2009 at 6:54 am
Actually the solution works fine, but the key is that you put this button in the target controller. i.e. add the back button BEFORE you push the next controller. Then the next controller will use this ‘back’ button to return. (It’s explained but not clearly in the documentation.)