UINavigationController "back button" custom text?

Ali Shafai picture Ali Shafai · Sep 18, 2009 · Viewed 98.5k times · Source

The "back button" of a UINavigationController by default shows the title of the last view in the stack. Is there a way to have custom text in the back button instead?

Answer

rein picture rein · Sep 18, 2009

From this link:

self.navigationItem.backBarButtonItem =
   [[UIBarButtonItem alloc] initWithTitle:@"Custom Title"
            style:UIBarButtonItemStylePlain
           target:nil
           action:nil];

As Tyler said in the comments:

don't do this in the visible view controller, but in the view controller that you'd see if you hit the back button