【发布时间】:2014-09-15 03:04:35
【问题描述】:
我一直在使用 AFNetworking 开发 xcode 5.0.2,一切正常。
当我升级到 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
和错误:Use of undeclared identifier '_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 并且错误仍然存在
有什么建议吗?
【问题讨论】:
-
看 stackoverflow.com/questions/24083358/… 已经有了答案,说明如何从 xcode 5.1 手动复制 sdk。
-
为什么要打扰这个?如果您真的想继续使用 Xcode 5,请使用 Xcode 5.1 - 它有 iOS 7.1。但是你现在真的应该开始使用 Xcode 6 并为 iOS 8 开发。
-
@nyekimov 如果您仔细阅读我的问题,您会发现我使用的是 xcode 5.0.2,因此我没有从 sdk 复制的 xcode 5.1 -->这就是我问的原因问题
-
@rmaddy 我已经下载了 XCode 6 以开始使用它,但是有一个编译器错误需要修复!
-
所以修复代码。无需在 Xcode 6 中安装不同的 SDK。