Open mbeloded opened 8 years ago
Hello @mbeloded , are you using any type of migration to update your data model? One possibility is to use lightweight migration. Before changing the entities, you have to create a new data model version (Editor->Add Model Version..). (https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreDataVersioning/Articles/vmLightweightMigration.html) Otherwise, it will crash like you've described due to inconsistent data models.
Editor->Add Model Version - did that, but it was crashed
Michael Bielodied mbeloded@gmail.com
On Jan 15, 2016, at 4:18 PM, jweihs notifications@github.com wrote:
Editor->Add Model Version
And have you switched your "current Model Version" to the newly created one as well in your .xcdatamodeld before updating your entities?
How are you setting up your Magical Record Stack? With setupAutoMigratingStack
or their equivalent?
i found a crash after updating a Data model, for example when i add a new field in some entity. Crash in line #64 of class MagicalRecordStack - "NSAssert([self store], @"No NSPersistentStore initialized for stack [%@]", stackType);". So, in such cases the stak is nil. I wrote some workaround and can share updated class with you. It works for me, hope you'll accept ith my solution. MagicalRecordStack.m.zip