我一直在使用xcode 5.0.2和AFNetworking进行工作,一切都运行得非常完美。但当我升级到xcode 6 GM版本时,我收到了警告:Auto property synthesis will not synthesize property 'cancelled' because it is 'readwrite' but it will be synthesized 'readonly' via another property
该警告出现在以下代码行:
@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];
}
我在stackoverflow上找到了这个答案,下载了Xcode 5.1.1并像建议的那样复制库,将基本SDK设置为7.1,但错误仍然存在。有什么建议吗?