我一直在使用AFNetworking处理xcode 5.0.2,一切都很完美.
当我升级到 xcode 6 GM时,我得到了警告:自动属性合成不会合成属性’已取消’,因为它是’readwrite’但它将通过此行上的另一个属性合成’readonly’:
当我升级到 xcode 6 GM时,我得到了警告:自动属性合成不会合成属性’已取消’,因为它是’readwrite’但它将通过此行上的另一个属性合成’readonly’:
@property (readwrite,nonatomic,assign,getter = isCancelled) BOOL cancelled
和错误:使用未声明的标识符’_cancelled’
- (void)cancel { [self.lock lock]; if (![self isFinished] && ![self isCancelled]) { [self willChangeValueForKey:@"isCancelled"]; _cancelled = YES; <-- THIS LINE CAUSES THE ERROR [super cancel]; [self didChangeValueForKey:@"isCancelled"]; // Cancel the connection on the thread it runs on to prevent race conditions [self performSelector:@selector(cancelConnection) onThread:[[self class] networkRequestThread] withObject:nil waitUntilDone:NO modes:[self.runLoopModes allObjects]]; } [self.lock unlock]; }
我在SO上发现this answer并下载xcode 5.1.1复制了库,就像建议将基本sdk设置为7.1并且错误仍然存在
有什么建议?
解决方法
NSOperation更改了其几个属性的读取访问者名称,取消了 – > isCancelled and finished – > isFinished(我想).在他们成为方法之前,但现在他们是属性.
AFNetworking需要更新为具有固定合成的版本. AFURLConnectionOperation.m文件现在具有以下解决此问题的方法.
@synthesize cancelled = _cancelled;
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。