将类发送到不兼容类型'id< UIWebViewDelegate>'的参数警告? [英] Sending Class to Parameter of Incompatible Type 'id<UIWebViewDelegate>' Warning?

查看:79
本文介绍了将类发送到不兼容类型'id< UIWebViewDelegate>'的参数警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我编写这行代码时,我没想到我的程序会大惊小怪:

I wasn't expecting my program to put up a fuss when I wrote this line of code:

[twitterFeed setDelegate:self];

twitterFeed是一个UIWebView设置,可以转到Twitter的移动网站,但这不是重点。我收到错误发送'SocialView(这个类的名称)到不兼容类型'id'的参数。我不知道如何解决它。有没有办法快速做到这一点,没有重新编译我的代码。

twitterFeed is a UIWebView set to go to Twitter's mobile site, but that's beside the point. I'm getting the error "Sending 'SocialView (the name of the class that this is in) to parameter of incompatible type 'id'. I don't know how to fix it. Is there any way to do this quickly and without restructuring my code too much.

另外,值得注意的是SocialView是一个UIViewController,如果这对你很重要。

Also, it is worth noting that SocialView is a UIViewController, if that's at all important to you.

谢谢!

推荐答案

你可以把< UIWebViewDelegate> 在您的 SocialView 界面声明中,看看是否修复了警告:

You could put <UIWebViewDelegate> in your SocialView interface declaration and see if that fixes the warning:

@interface SocialView : UIViewController <UIWebViewDelegate> {
...
}

这篇关于将类发送到不兼容类型'id&lt; UIWebViewDelegate&gt;'的参数警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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