I have set up one of my core data attributes as a Boolean. Now, I need to set it, but XCode keeps telling me that it may not respond to setUseGPS.
[ride setUseG
Core Data "does not have" a Boolean type (it does, but it is an NSNumber).
So to set the equivalent of useGPS = YES.
[entity setUseGPS:[NSNumber numberWithBool:YES]];
And the other way around:
BOOL isGPSOn = [[entity useGPS] boolValue];
Update: As pointed out by SKG, With literals in Objetive-C you can now do it in a simpler way:
[entity setUseGPS:@YES];
BOOL isGPSOn = entity.useGPS.boolValue;