No visible interface for dismissModalViewControllerAnimated:completion

我是研究僧i 提交于 2019-12-24 00:35:42

问题


I have a UIViewController derived class which uses the method dismissModalViewControllerAnimated:(BOOL), like this:

[self dismissModalViewControllerAnimated:YES];

Since the compiler complains with a warning saying that this method is deprecated, I have changed it to the suggested replacement, dismissModalViewControllerAnimated:completion:, like this:

[self dismissModalViewControllerAnimated:YES completion:nil];

But now, a get an error in that line of code saying "No visible @interface for declares the selector dismissModalViewControllerAnimated:completion:

I can't see what's the problem, since both methods are defined in UIViewController.h, and my class derives from that class.

What am I doing wrong?

Thank you in advance


回答1:


It was my fault. The new method is

[self dismissViewControllerAnimated:YES completion:nil];

not

[self dismiss**Modal**ViewControllerAnimated:YES completion:nil];

Thank you all, and excuse me for my silly question.



来源:https://stackoverflow.com/questions/12782742/no-visible-interface-for-dismissmodalviewcontrolleranimatedcompletion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!