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
The "fix" for this (IMHO, it's a bug in Apple's SDK) is to add the following code to your CoreData-generated class. NB: if you do this in a category, in a separate file, then you don't have to re-copy/paste it each time you regenerate the CoreData classes inside Xcode
- (BOOL)useGPS
{
[self willAccessValueForKey:@"useGPS"];
BOOL myuseGPS = [[self primitiveUseGPS] boolValue];
[self didAccessValueForKey:@"useGPS"];
return myuseGPS;
}
- (void)setUseGPS:(BOOL)newValue
{
[self willChangeValueForKey:@"useGPS"];
[self setPrimitiveUseGPS:[NSNumber numberWithBool:newValue]];
[self didChangeValueForKey:@"useGPS"];
}