简体   繁体   中英

Cancel button in Navigation View not working

取消按钮 code for cancel button is

- (IBAction)cancelButton:(id)sender {
    [self dismissViewControllerAnimated:YES completion:nil];
}

While tracing the program I can see the method is called however the view is not dissmissing to the previous view controller.

if you use Navigation View controller you should use

[self.navigationController popViewControllerAnimated:YES];

instead of dismissViewControllerAnimated

PS actually, I think you use storyboards and segues and in this case you should use UnwindSegue What are Unwind segues for and how do you use them? Also you should read some common documentation about in app navigation...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM