【发布时间】:2012-12-07 17:11:30
【问题描述】:
我有一个自定义委托和数据源。但是当我尝试初始化它时,我遇到了几个问题。在我的 .h 文件中,如果有的话。
@property (nonatomic, assign) id<UITableViewDelegate> delegate;
@property (nonatomic, assign) id<KalDataSource> dataSource;
这导致在 .m 文件的合成中出现以下错误。
Existing ivar 'dataSource' for property 'dataSource' with assign attribute must be __unsafe_unretained.
经过一些谷歌搜索后,我发现我应该像这样评估我的变量。
@property (nonatomic, strong) id<UITableViewDelegate> delegate;
@property (nonatomic, strong) id<KalDataSource> dataSource;
但是我得到了这个错误。
linker command failed with exit code 1 (use -v to see invocation)
谁能帮我解决这个问题?
亲切的问候!
【问题讨论】:
标签: iphone objective-c ios delegates datasource