应用程序委托发出警告:“id”不符合“UIAlertViewDelegate”协议
我目前在我的应用程序中启动时使用 UIAlertView 和 UIAlertViewDelegate。一切都很好。唯一的问题是,每次引用 App Delegate 时,我都会收到警告“type 'id '不符合 'UIAlertViewDelegate' 协议”,这给了我大约 32 个警告。
谁能解释一下我为什么收到此警告以及如何满足它?
提前致谢!
I'm currently using a UIAlertView at startup in my app with the UIAlertViewDelegate. It all works fine. The only problem is, I get the warning "type 'id ' does not conform to the 'UIAlertViewDelegate' protocol" every time I reference the App Delegate, giving me about 32 warnings.
Can anyone shed some light on why I'm getting this warning and how I can satisfy it?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我假设您的应用程序委托是您的警报视图委托?
如果是这样,您需要在应用程序委托的声明中告诉编译器。像这样:
然后你还需要实现所需的方法。
编辑:进一步考虑一下,我认为当您引用应用程序委托时,您可能错过了演员表。所以你有这样的东西:
I assuming your app delegate is your alert view delegate?
If so, you need to tell the compiler that in the declaration of the app delegate. Like so:
And then you also need to implement the required methods.
EDIT: Thinking about it further, I think probably you're missing a cast when you reference the app delegate. So you have something like this:
它可能不存在于主线程上,请尝试
It might not exist on the main thread, try