0

In my application I have a dataloss issue with core data or sqlite with iOS7. I was using the app and added some data and save data to coredata calling save on managedObjectContext. I'm using single instance of managedObjectContext with lock/unlock. After adding some data I closed the app by pressing home button. I opened the app after around two and half hour and I lost all data which I saved before closing app. I have no clue what went wrong, because I'm committing data on each save in the application, then the lose could happen on last couple of transactions but how can I lost data which I entered in 15min usage.

Any help would be great. Thanks.

Jitendra Singh
  • 2,103
  • 3
  • 17
  • 26
  • Post some of the relevant code. Your question does not include any information that would indicate a problem, so you'll need to add more information to get any kind of answer. – Tom Harrington Sep 26 '13 at 21:32

1 Answers1

0

We had the same problem something changed in iOS 7 in handling conflicts. we have from some reasons conflicts (we are still investigating this but it is there since day 1) and once trying to save such a conflict the aplication simply stops writing things to the store.

This is what we used at the end in order to avoid data loss - NSMergeByPropertyObjectTrumpMergePolicy https://developer.apple.com/library/mac/documentation/CoreData/Reference/NSMergePolicy_Class/Reference/Reference.html#//apple_ref/doc/c_ref/NSErrorMergePolicy

kguest
  • 3,804
  • 3
  • 29
  • 31
oamrani
  • 21
  • 3
  • Correct. In error the conflicted object had same data but was still failed with conflict error. We also used the same merge policy for now to avoid data loss. Please post back if you find the reason. – Jitendra Singh Oct 02 '13 at 14:46