Closed nullproduction closed 10 years ago
You're getting that exception because your persistent store has changed and you're holding on to an NSManagedObject
from the previous store, which is now invalid. After PersistentStack storesWillChange:
is called any NSManagedObject
you had previously is now invalid. That's why we save
and reset
the NSManagedObjectContext
to prepare for the new store.
In your implementation of storesWillChange
you'll need to ensure that your app doesn't hold onto any NSManagedObject
objects. You need to be prepared to receive a completely new set of data.
Thanks for the reply.
Thanks for the good example. If you create an entry in CoreData, and then add in the settings of your account icloud.
Old records records disappear + crash:
How to synchronize the data added by the user before connect the iCloud?