![](/img/trans.png)
[英]"Cancel" button (UIBarButtonItem) not working in iOS view controller
[英]Cancel button in Navigation View not working
取消按鈕的代碼是
- (IBAction)cancelButton:(id)sender {
[self dismissViewControllerAnimated:YES completion:nil];
}
在跟蹤程序時,我可以看到該方法被調用了,但是視圖並沒有移交給先前的視圖控制器。
如果您使用Navigation View控制器,則應使用
[self.navigationController popViewControllerAnimated:YES];
而不是dismissViewControllerAnimated
PS:實際上,我認為您使用情節提要和腳本,在這種情況下,您應該使用UnwindSegue。Unwindsegue的作用是什么?如何使用它們? 另外,您還應該閱讀一些有關應用程序導航的常見文檔...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.