Cannot synthesize weak property in file using manual reference counting

Cannot synthesize weak property in file using manual reference counting

在MRC环境下使用delegate的时候报错:

Cannot synthesize weak property in file using manual reference counting

errorImage

1、开启MRC模式:设置OC自动引用计数为NO。Building Setting->Objective-C Automatic References Counting设置为NO。

2、调试时发现代理指针报如上错误。

3、解决办法:

将引用计数设置下面的Weak References in manual Retain Release设置为YES就好了。

参考stackOverflow

猜你喜欢

转载自blog.csdn.net/morris_/article/details/79901875