UIBarButtonItem *newBackButton =
[[UIBarButtonItem alloc] initWithTitle:@"NewTitle"
[[self navigationItem] setBackBarButtonItem:newBackButton];
Jordan says he "[added] a little more clarity on where to put the code." Here is even more clarity: put it in the first (aka parent) controller, immediately before the call to push the second (aka child) controller.
This should be placed in the method that calls the ViewController titled "NewTitle".
Right before the push or popViewController statement.
To change the back button for my third level view controller (second push) I had to use the following line instead of the above answer: [[self.parentViewController navigationItem] setBackBarButtonItem: newBackButton]; Am I doing something wrong?
When in the child view controller, calling this from the child view controller will not work. You have to call this from the parent view controller, while within the child view controller.
You don't have to do this right before push or pop. You can do it in viewDidLoad or loadView or wherever else you set the title and other properties for this view. Victor Bogdan's answer below is clearer, IMHO.
you can create a custom BaseViewController and put it in to -viewDidLoad: