[问题记录]Property with 'retain (or strong)' attribute must be of object type

来源:互联网 发布:客户端缓存 js 编辑:程序博客网 时间:2024/04/28 08:21

引用第三方开源库"Reachability.h",编译的时候报错:

Property with 'retain (or strong)' attribute must be of object type


发现错误是在:

@property (nonatomic, strong) dispatch_queue_t          reachabilitySerialQueue;


搜索了一番,原来这是因为SDK低于6.0时,dispatch_queue_t  ARC没有托管,出现错误

只需将报错这一段修改为:


#if OS_OBJECT_USE_OBJC
@property (nonatomic,
strong) dispatch_queue_t          reachabilitySerialQueue;
#else
@property (nonatomic,
assign
) dispatch_queue_t          reachabilitySerialQueue;
#endif


即可解决问题!


0 0