Browse files

using valueForKeyPath: instead of valueForKey for pulling relationshi…

…p object data from import data

This allows you to actually use a multi-level key path for mappedKeyName for a relationship.
  • Loading branch information...
1 parent 52139bd commit f55ab4c8a5cbc5e339fdcafdc5a6d0e76e2ecacc @cmezak committed Oct 15, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.m
View
2 MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.m
@@ -137,7 +137,7 @@ - (void) MR_setRelationships:(NSDictionary *)relationships forKeysWithObject:(id
NSRelationshipDescription *relationshipInfo = [relationships valueForKey:relationshipName];
NSString *lookupKey = [[relationshipInfo userInfo] valueForKey:kMagicalRecordImportRelationshipMapKey] ?: relationshipName;
- id relatedObjectData = [relationshipData valueForKey:lookupKey];
+ id relatedObjectData = [relationshipData valueForKeyPath:lookupKey];
if (relatedObjectData == nil || [relatedObjectData isEqual:[NSNull null]])
{

0 comments on commit f55ab4c

Please sign in to comment.