Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

gormster

macrumors newbie
Original poster
Jan 21, 2010
8
0
Hi guys

I've got a bit of a weird problem. I've got a one-to-one relationship between two entities in my Core Data model, called Trigger and View. (Before you jump on that, I've already tried renaming it, it's not a reserved word issue.)

Here's the extremely odd thing - I can't seem to traverse this relationship through KVC. Here's some code

Code:
//this works
NSManagedObject* view = [trigger valueForKey:@"view"];
int locx = [[view valueForKey:@"locX"] intValue];

//this doesn't
int locx = [[trigger valueForKey:@"view.locX"] intValue];

WTF. Both objects were instantiated with the insertNewObjectForEntityForName:inManagedObjectContext: method of NSEntityDescription, and the view was assigned to the trigger by was of setValue:forKey:. The error I get is 'the entity Loop is not key value coding-compliant for the key "view.locX".'
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.