, "", UINavigationBar, .
The default action for the back button is to pop the current view manager from the navigation stack and return to the previous view manager. If you want to define custom behavior in the lining, you will need to create a new button and bind the action to it:
UIBarButtonItem *barbutton = [[UIBarButtonItem alloc] initWithTitle:@"Back"
style:UIBarButtonItemStyleDone target:self action:@selector(doSomething)];
self.navigationItem.leftBarButtonItem = barbutton;
[barbutton release];
Edit:
// An example of how to implement the doSomething method.
-(void) doSomething
{
[self.navigationController popViewControllerAnimated:YES];
}
source
share