Your question already has an answer. You need to focus on them, look for them if they exist an update; otherwise insert. There is no other way.
Since you delete one value, you can get all the relevant objects at once by setting the predicate:
[myFetchRequest setPredicate:[NSPredicate predicateWithFormat:@"timestamp in %@", myArrayOfIncomingTimestamps]];
This will give you all the objects that already exist in a malfunctioning state. You can then run the memory predicate in this array to retrieve existing objects to update them.
Also a word of advice. Timestamp is a terribly unique identifier. I would highly recommend you review this.
source
share