I’m having a curious issue with backBarButtonItem. I want to replace its title in the entire application for “Back” and replacing the back button works in most of -viewDidLoad event but in other views it’s not working and show the name of the previous view. Has someone has the same problem?
P.S. The way to replace the backBarButtonItem is the standard one instantiating an UIBarButtonItem and setting it to viewController.navigationIten.backBarButtonItem property.
Well, at last I’ve found the solution to this issue.
If you want that any backBarButtonItem of your application has the same title a good approach is to subclass UINavigationController and override
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animatedto replace the back button.By this way every back button in your application will have the same title.
I hope this will be helpful for anyone else.