小编Dyl*_*ich的帖子

声明委托ivar时出现ARC错误

我正在使用ARC(不,这不是NDA).我在我的界面中宣布我的ivar

id itemDelegate;
Run Code Online (Sandbox Code Playgroud)

然后我宣布财产:

@property (nonatomic, weak) id<mySecretDelegateYouAreNotSupposedToSeeOnSO> itemDelegate; (由于ARC而弱而不是分配)

在我的实现文件中,我只是合成它: @synthesize itemDelegate;

但是,我收到错误:

"Existing ivar 'ItemDelegate' for _weak property 'itemDelegate' must be _weak".
Run Code Online (Sandbox Code Playgroud)

谁知道什么是错的?谢谢你的帮助.

ARC - 自动参考计数

iphone ios automatic-ref-counting

27
推荐指数
2
解决办法
2万
查看次数

标签 统计

automatic-ref-counting ×1

ios ×1

iphone ×1