首页 > 其他 > 详细

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

时间:2015-06-11 19:05:16      阅读:97      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!