iOS Assigning to 'id' from incompatible type 'BViewController *__strong'

在使用代理的时候,

    BViewController *BVC = [[BViewController alloc]init];
self.delegate = BVC;

出现这样的警告Assigning to 'id<XXXDelegate>' from incompatible type 'BViewController *__strong'

解决方案:

#import "BViewController.h"

@interface BViewController ()<XXXDelegate>

@end

在BViewController.h中 添加:XXXDelegate 即可

上一篇:python 序列化 json pickle


下一篇:(转)C# -- 扩展方法的应用(Extension Methods)