Suppose there is a web service returning a JSON response like this:
{
"id": "123",
"name": "John Doe",
"phone": {
"country_code": "1",
"area_code": "11",
"number": "55544433"
}
}
This is describing a Person entity, but inside this entity, there is the phone property containing an embedded object.
Phone is not an entity and it is not referenced by an id, it is fully contained inside the scope of this Person entity. However, it would be desirable to map it to a Phone @interface in my code (for example, it could have a method "formatAsString" that returns a formatted string like this: "+1 (11) 55544433")
How should I handle this case when mapping the model to iOS Core Data?