I've been struggling with trying to figure out why I'm experiencing merge conflicts when trying to save my managedObjectContext.
My app is using a single MOC on the main thread only. There are no background tasks being completed in Core Data. (User sees a fetched list of categories/items, can add to the list or delete from the list.) The app is seeded with data upon initial launch via a bundled SQLite file.
If I use a SQLite file with a small amount of records (~50) in one of the two tables, saving new objects w/ the MOC works fine. If I use the same SQLite file and add more records to that same table (~40,000) the app displays them fine but crashes upon trying to same the MOC. There error is:
Code=133020 "Could not merge changes" "...with oldVersion = 0 and newVersion = <deleted> and old cached row ="
The item cited in the error message is a random category/item each time and not the new category/item being saved w/ the MOC.
I've tried various merge policies although they all have the same effect: the new object is not saved. I'm puzzled why it appears that when the larger data set is being used CoreData thinks a completely different object is being deleted and fails to insert the new object.