我正在尝试更改特定后退按钮的操作,但由于某种原因它没有调用我给他的方法。这很奇怪,因为标题确实发生了变化,所以我认为它也应该适用于该动作。这是我的按钮代码:
UIBarButtonItem *backButton = [[UIBarButtonItem alloc]
initWithTitle: @"Back"
style: UIBarButtonItemStyleBordered
target:self action: @selector(goBackToChooseMovie)];
[self.navigationItem setBackBarButtonItem: backButton];
这是我的方法:
-(void)goBackToChooseMovie{
ViewController *VC = (ViewController *)[self.navigationController.viewControllers objectAtIndex:0];
VC.showingPhotoLibraryFromCamera = YES;
[self dismissViewControllerAnimated:YES completion:nil];
[self.navigationController popToRootViewControllerAnimated:NO];
}