I have to tables: Contract and ContractDetails which are connected with a relationship.
First I query for all Contracts using Restkit. Then a user taps on one Contract and forces a request to get the detail-data (ContractDetails).
the Contract-Details-JSON-response is something like this:
{
"contractID" = "0815",
"otherValues" = "doesn't matter here"
}
how do I setup a relationship between the two tables in my RestKit-configuration? RestKit should look up the Contract-Entry using the contractID and connect the detailsdata with the contractdata.
See the “Relationships” section of https://github.com/RestKit/RestKit/wiki/Object-mapping.
Essentially, you create a mapping for both the Contract and ContractDetails and connect them via:
[detailsMapping mapKeyPath:@”contractID” toRelationship:@”contract” withMapping:contractMapping];