I have a question to ask regarding Coredata entity relationships. Can one entity have multiple relations with another entity. I have the following json:
{
"user": {
"user_id": "192837190283",
"email": "ceo@me.com",
"first_name": "Tim",
"last_name": "Cook",
"home_address": {
"street": "Downing Street",
"number": "11",
"city": "London",
"state": "Greater London",
"country": "United Kingdom",
"zip": "12323423",
"location": {
"latitude": 3.1,
"longitude": 3.2
}
},
"work_address": {
"street": "Amphitheatre Parkway",
"number": "1600",
"city": "Mountain View",
"state": "California",
"country": "United States",
"zip": "94043",
"location": {
"latitude": 3.1,
"longitude": 3.2
}
}
}
}
I have the follow model in Coredata :
Still, when I parse json, it still saves only one address. Am I doing something wrong with relations? Please suggest. Thanks in advance.