Skip to content

Commit

Permalink
Merge pull request #799 from maximmalygin/release/3.0
Browse files Browse the repository at this point in the history
Fix data import of ordered relationships
  • Loading branch information
tonyarnold committed Jan 21, 2016
2 parents 6c2ac62 + 1a6dfab commit f3dc859
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ - (void)MR_setObject:(NSManagedObject *)relatedObject forRelationship:(NSRelatio
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:selector]];
[invocation setSelector:selector];
[invocation invokeWithTarget:self];
[invocation getReturnValue:&relationshipSource];

__unsafe_unretained id orderedSet;
[invocation getReturnValue:&orderedSet];
relationshipSource = orderedSet;

addRelationMessageFormat = @"addObject:";
}
Expand All @@ -108,7 +111,7 @@ - (void)MR_setObject:(NSManagedObject *)relatedObject forRelationship:(NSRelatio

@try
{
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:selector]];
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[relationshipSource methodSignatureForSelector:selector]];
[invocation setSelector:selector];
[invocation setArgument:&relatedObject atIndex:2];
[invocation invokeWithTarget:relationshipSource];
Expand Down

0 comments on commit f3dc859

Please sign in to comment.