Here’s the question. I have a table where I save some data, which I get from a NSArray of NSDictionaries which will have the properties to be saved. Each dictionary in the array is a separated entity, so I loop the dictionary and save it using insertNewObjectForEntityForName to create diferent entity.
I need to refesh the data, but when is saving the data is duplicating the data that exist already in coredata. Im trying to check if the id exist on the core data using
for(NSDictionary *exist in dic){
if([[campaignDictionary objectForKey:@"element"] isEqualToString:@"id"]){
idToCheck = [dic objectForKey:@"value"];
}
}
if(table.campaign_id == idToCheck){
return exist = YES;
}
but its leaving the rest of the data without being checked, so only the id not being duplicated, any ideas to how approach this? thanks!
I decided it was best to delete all my content from Coredata before inserting the new content, thanks!!