Big trouble after app update. CoreData migration error

Posted by MrBr on Stack Overflow See other posts from Stack Overflow or by MrBr
Published on 2012-09-04T10:09:40Z Indexed on 2012/09/06 9:38 UTC
Read the original article Hit count: 245

this morning we had a big trouble with our iphone app. We had to even take it off the store.

The thing is that we made real small changes to our xcdatamodel. We thought that the update process is automatically taking care about exchanging it the right way until we found out something like CoreData migration exists.

We are using the UIManagedDocument to connect to the persistent store.

How is it possible to exchange this file with the new one? While we were developing we just uninstalled the whole app from the device and then installed it again and everything worked. How can we simulate this process in the app store with updates?

UPDATE

I try to set the migration option like this

_database = [[UIIManagedDocument alloc] init];
NSMutableDictionary *options = [[NSMutableDictionary alloc] init];
[options setObject:[NSNumber numberWithBool:YES] forKey:NSMigratePersistentStoresAutomaticallyOption],

_database.persistentStoreOptions = options;

but the app is still crashing with

** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'This NSPersistentStoreCoordinator has no persistent stores. It cannot perform a save operation.'


© Stack Overflow or respective owner

Related posts about ios

Related posts about core-data