Sending 'ViewController *const __strong' to parameter of incompatible type 'id'

看到项目中又警告总感觉别闹,就好像一只苍蝇在你眼前飞来飞去的。总想着解决它。

最近出现如下警告:

Sending 'ViewController *const __strong' to parameter of incompatible type 'id<某Delegate>'

走了好多弯路。最后才发觉是没有实现相应协议,哎,真的服了我了。

只需要在

@interface  控制器名  后面加上<协议名>



版权声明:本文为qq_22220403原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。