I have questions with relationships. I have to NSManagedObject classes Team and Player. Team can contain many players. Player can contain only one team.
Here is the
I solved this problem one thing I miss was mappedKeyName for the Relationship's user info.
At first we need to set mappedKeyName for the relationship that corresponds to the JSON key.
So in case if JSON you got looks like below:
{
"status": 1,
"message": "success",
"player": {
"playerID": 1,
"teamID": 14,
"firstname": "NAME",
}
}
mappedKeyName key will be player.teamID
relatedByAttribute key will be teamID that is an attribute of the Team entity.
Hope it helps someone.
Have a look at this answer I posted for another question similar to yours:
Magical Record import (next step)