I'm getting the following output:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason:
'[<NSManagedObject 0x21016610> setValue:forUndefinedKey:]: the entity MyEntity is
not key value coding-compliant for the key "aBooleanKey".'
The code that runs before I get the output is the following:
self.name = [managedObject valueForKey:@"name"];
self.language = [managedObject valueForKey:@"language"];
self.ownerID = [managedObject valueForKey:@"ownerID"];
// the following line is the scope of the problem:
self.aBooleanKey = [[managedObject valueForKey:@"aBooleanKey"] boolValue];
For me this looks like a mistyping or something, since all other entity attributes don't cause any problem. But I checked like twelve times and can't find any mistyping or so. It all looks just right. And a week ago it all worked just fine – I didn't change anything here.
Also there are a few other places where I do things with the managedObject
and likewise all other attributes work just fine except this one. I tried deleting it in the Core Data store and retyping it, but it didn't solve the problem.
Are there any other reasons for this error?