码迷,mamicode.com
首页 > 其他好文 > 详细

在ARC工程引入非ARC时,出现__unsafe_unretained

时间:2015-06-11 19:08:17      阅读:138      评论:0      收藏:0      [点我收藏+]

标签:

 

在ARC工程引入非ARC时,出现__unsafe_unretained

分类: object-c

@interface MDSpreadView : UIScrollView {

  @private

    id <MDSpreadViewDataSource> _dataSource;

}

 

@property (nonatomic, assign) IBOutlet id <MDSpreadViewDataSource> dataSource;

上面一段在编译时出现existing instance variable ‘_dataSource‘ for property ‘dataSource‘ with  assign attribute must be __unsafe_unretained

 

将上一段改为

 

 

@interface MDSpreadView : UIScrollView {

  @private

    id <MDSpreadViewDataSource>__unsafe_unretained _dataSource;

}

 

@property (unsafe_unretained) IBOutlet id <MDSpreadViewDataSource> dataSource;

问题就可以解决

在ARC工程引入非ARC时,出现__unsafe_unretained

标签:

原文地址:http://www.cnblogs.com/yintingting/p/4564766.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!