Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit f55ab4c8a5cbc5e339fdcafdc5a6d0e76e2ecacc 1 parent 52139bd
@cmezak authored
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]])
{
Please sign in to comment.
Something went wrong with that request. Please try again.