iOS Assigning to 'id<XXXDelegate>' 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 即可

原文地址:https://www.cnblogs.com/jukaiit/p/5009688.html