没有可见的dismissModalViewControllerAnimated接口:完成 [英] No visible interface for dismissModalViewControllerAnimated:completion

查看:111
本文介绍了没有可见的dismissModalViewControllerAnimated接口:完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个UIViewController派生类,它使用方法 dismissModalViewControllerAnimated:(BOOL),如下所示:

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

[self dismissModalViewControllerAnimated:YES];

由于编译器抱怨警告称此方法已弃用,我已将其更改为建议替换, dismissModalViewControllerAnimated:completion:,如下所示:

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];

但现在,在该行代码中出现错误,说没有可见的@interface for 声明选择器 dismissModalViewControllerAnimated:completion:

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

我看不出有什么问题,因为这两个方法都在 UIViewController.h 中定义,而我的类派生自该类。

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

我做错了什么?

提前谢谢

推荐答案

这是我的错。
新的方法是

It was my fault. The new method is

[self dismissViewControllerAnimated:YES completion:nil];

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

谢谢大家,请原谅我的愚蠢问题。

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

这篇关于没有可见的dismissModalViewControllerAnimated接口:完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆