I need to map this data into one Core Data object (EventList).
{
"eventList":[
{
"code":"hhel444440lhxxxxxn",
"name":"Test Event",
"id":"222495710159sdfdfd8000000",
"status":"Open",
"urls":[
{
"hostURL":"mything.association.somedomain.com",
"module":"association",
},
{
"hostURL":"mything.mobile.somedomain.com",
"module":"mobile",
}
]
}
]
}
====== I need it mapped to these attributes on my class ===========
@dynamic code;
@dynamic name;
@dynamic id;
@dynamic status;
@dynamic hostURL;
The hostURL should only be mapped if the value for module == mobile so in this case we don’t want the url from the first of the urls where module == association. We need to skip the first one.
I am trying to use DynamicMapping, but when I try dynamic mapping I am getting:
valueForUndefinedKey:]: the entity (null) is not key value coding-compliant for the key “hostURL”.’
Got it. I was cutting and pasting from other code I had written in missed changes.