我有一个 UIViewController 派生类,它使用 dismissModalViewControllerAnimated:(BOOL)
方法,如下所示:
[self dismissModalViewControllerAnimated:YES];
由于编译器提示并警告说此方法已弃用,我已将其更改为建议的替代方法,dismissModalViewControllerAnimated:completion:
,如下所示:
[self dismissModalViewControllerAnimated:YES completion:nil];
但是现在,在该行代码中出现错误“No visible @interface for declares the selector dismissModalViewControllerAnimated:completion:
我看不出有什么问题,因为这两种方法都在 UIViewController.h 中定义,而我的类派生自该类。
我做错了什么?
提前致谢
最佳答案
是我的错。 新方法是
[self dismissViewControllerAnimated:YES completion:nil];
不是
[self dismiss**Modal**ViewControllerAnimated:YES completion:nil];
谢谢大家,请原谅我的愚蠢问题。
关于objective-c - dismissModalViewControllerAnimated 没有可见界面 :completion,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12782742/