0

I use operations in operation queue which update data and send notifications at the end.

My problem is I may process the old data while a new entities are already available and this causes an exception. I could process the old data and then process the new ones but I must to store/copy old data anyways.

How to solve this issue if Core Data doesn't allow to retain/copy its managed objects? I tried MagicalRecord but both it and pure Core Data don't provide the ready necessary solutions.

Gargo
  • 1,135
  • 1
  • 10
  • 21
  • I used parentContext to create a temporary Entity object to store the old data, then let the new entries in. Without saving the parentContext, the old data will not go into the context and occur conflict. I delete that old data object later on. Not sure this way is good for you though. – John Nov 23 '14 at 12:33
  • could you place an example – Gargo Nov 23 '14 at 13:39
  • I tried to find some examples from my old projects but yet nothing. You can look into this SO thread and see the second answer using parentContext. http://stackoverflow.com/questions/10166592/create-an-nsmanagedobject-without-saving – John Nov 23 '14 at 15:42
  • Or this one using no context: http://stackoverflow.com/questions/3256195/how-to-deal-with-temporary-nsmanagedobject-instances – John Nov 23 '14 at 15:52

0 Answers0