I have a navigationController-based app. I want to change the title of the back button for the root view controller. I have tried the following code in the rootViewControlle
Possibly already answered, but not simply.
self.navigationItem.backBarButtonItem defaults to nil. So if you set the title to it, nothing will happen because it is affecting a nil address object. This won't throw an error, because objective-c allows messaging nil objects.
ANSWER: You must create your own button object in order to set it's title. You can initWithTitle or create it and then set the title afterward.
PS - as mentioned, the backBarButtonItem only affects it's child views that are pushed on top of it in the navigation stack. Depending on how you have your app architected, the root view can't be popped any further and can't have a back button. Though, you can affect the leftBarButtonItem.