I've been working on xcode 5.0.2 with AFNetworking, everything worked perfectly.
when I upgraded to xcode 6 GM I got the warnining: Auto property synthesis will not synthesize property 'cancelled' because it is 'readwrite' but it will be synthesized 'readonly' via another property
on this line:
@property (readwrite, nonatomic, assign, getter = isCancelled) BOOL cancelled
and error: 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];
}
I found this answer on SO and downloaded xcode 5.1.1 copied the library like suggested set the base sdk to 7.1 and the error remains
any suggestions?
NSOperation
changed the read accessor names for a couple of its properties, cancelled -> isCancelled and finished -> isFinished (I think). Before they were methods, but now they are properties.
AFNetworking
needs to be updated to a version that has the fixed synthesizing. The AFURLConnectionOperation.m file now has the following to fix this issue.
@synthesize cancelled = _cancelled;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With