@property (readwrite, nonatomic, assign, getter = isCancelled) BOOL canceled - xcode6 causes a compiler error

I am working on xcode 5.0.2 with AFNetworking, everything works fine. when I upgraded to xcode 6 GM, I received a warning: Auto property synthesis will not synthesize property 'cancelled' because it is 'readwrite' but it will be synthesized 'readonly' via another property in 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 as suggested to install the base sdk in 7.1, but the error remains

any suggestions?

+8
ios xcode sdk
source share
1 answer

NSOperation changed the names of the reading accessories for several of its properties, canceled β†’ isCancelled and finished β†’ isFinished (I think). Before they were methods, but now they are properties.

AFNetworking needs to be upgraded to a fixed synthesis version. In the AFURLConnectionOperation.m file, the following steps must be taken to resolve this issue.

 @synthesize cancelled = _cancelled; 
+4
source share

All Articles