I need a custom leftBarButtonItem on my navigation bar because I need to perform a function in the view controller when the view is popped. I would like to have the back button have the correct title (of the view controller below). So two questions:
1) Can I get the title of the standard backBarButton item somehow, so that I can manually set my custom button’s title?
or
2) Is there another hook/event that I can use that is only called when the user pops the view?
Re 2: I found one solution using:
NSArray *viewControllerArray = [self.navigationController viewControllers];
int parentViewControllerIndex = [viewControllerArray count] - 2;
But this array is (null) for me.
PS I’m using Three20.
There’s a UIViewController function which gets triggered when the view controller disappears from the screen: