Can RestKit connect a relationship without storing the foreign key as an attribute, i.e., directly from the keypath in the JSON?
In particular, I\'ve got a Job has_many
I would make JobId a transient value in core data, and write a custom set and get for it.
The set would set the relationship to self.job=methodToReturnObjectMatchingJobId (this would be used by rest kit)
The get would return self.job.identifier
If you are not using mogenerator, I would suggest you have a look at it for all your core data needs.
Below is sample code of how i did it:
-(void) setClaimId:(NSNumber *)claimId{
Claim *propertyClaim=[Claim listItemFromId:[claimId intValue] withContext:self.managedObjectContext];
self.claim=propertyClaim;
}
-(NSNumber*) claimId{
return self.claim.referenceId;
}
where listItemFromId is a simple query that returns the object based on the id.