Skip to content
This repository

Ordered child relationship fails in DataImport. #430

Closed
wants to merge 1 commit into from

3 participants

Craig Heneveld Joshua Greene Tony Arnold
Craig Heneveld

DataImport was failing when a ordered one to many child relationship was being processed. Previously, the importer was calling (ex: relationship name was say videos) videosSet instead of just videos, fixed now and will just call videos

Craig Heneveld cheneveld DataImport was failing when a ordered one to many child relationship …
…was being processed. Previously, the importer was calling (ex: relationship name was say videos) videosSet instead of just videos, fixed now and will just call videos
e64b392
Joshua Greene

The Good News: this fixes data import for NSOrderedSets! Awesome!

The Bad News: this appears to break setting the inverse relationship on the added object... : /

Ideas? I'm currently looking into a solution to fix this.

Joshua Greene

I've got a fix for it here:

#440

Cheers!

Tony Arnold
Owner

Given the age of this issue, and the volume of issues we have to work through, I've decided to close this alongside a number of other older issues.

If you can still replicate the issue under the latest in-development version of MagicalRecord (3.0 at the time of writing), please feel free to re-open and one of @magicalpanda/team-magicalrecord will take another look. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Mar 15, 2013
Craig Heneveld cheneveld DataImport was failing when a ordered one to many child relationship …
…was being processed. Previously, the importer was calling (ex: relationship name was say videos) videosSet instead of just videos, fixed now and will just call videos
e64b392
This page is out of date. Refresh to see the latest.
3  MagicalRecord/Categories/NSManagedObject/NSManagedObject+MagicalDataImport.m
@@ -101,8 +101,7 @@ - (void) MR_addObject:(NSManagedObject *)relatedObject forRelationship:(NSRelati
101 101 if ([relationshipInfo respondsToSelector:@selector(isOrdered)] && [relationshipInfo isOrdered])
102 102 {
103 103 //Need to get the ordered set
104   - NSString *selectorName = [[relationshipInfo name] stringByAppendingString:@"Set"];
105   - relationshipSource = [self performSelector:NSSelectorFromString(selectorName)];
  104 + relationshipSource = [self performSelector:NSSelectorFromString([relationshipInfo name])];
106 105 addRelationMessageFormat = @"addObject:";
107 106 }
108 107 }

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.