It's a little hard to explain, but I'm trying to use NSPredicate to filter an array using a custom NSManagedObject using identifiers. I have a server that can send updates, delete or add new objects, and I need to manage if these objects from the JSON file already exist, if they simply update them or insert them into the main data, if not.
I am using this predicate now:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"storeId != %@", [jsonFile valueForKey:@"Id"];
Where jsonFile contains Unparsed Store objects. But with this predicate, it will give me a huge array, since one id will be different from some storeId, and the next id will match.
The json file is something like this:
"Stores":[{ "id":1, "name":"Spar", "city":"London" } { "id":2, "name":"WalMart", "city":"Chicago" }];
lagos source share