I'd like to change action of my backbutton in one of my ViewController. Instead of going back to the precedent view, I want to perform an action in the same ViewController.
self.navigationItem.hidesBackButton=NO;
hides the BackButton but
[self.navigationController.navigationItem.backBarButtonItem setAction:@selector(performBackNav:)];
and
[self.navigationItem.backBarButtonItem setAction:@selector(performBackNav:)];
do the same as before (going back to precedent ViewController). Nothing changes.
-(void)performBackNav:(id)sender {
//Actions
[self.navigationController popViewControllerAnimated:NO];
}
Any ideas to modify backbarbuttonitem's action ?