mercredi 28 janvier 2015

Core data Versioning (Lightweight migration) Issue

I am using core data in my app and its first version was released in october. Then i made some changes in the data model and uploaded the next version. It started crashing on the device of existing users(crashing on startup), but it was running properly when they re install it or when new user download it. Then i learned about versioning and created a new version ie 1.1 and added following options NSDictionary *dictionary = @{ NSMigratePersistentStoresAutomaticallyOption :@YES, NSInferMappingModelAutomaticallyOption : @YES };


to



[_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:options error:&error]


I tested this on simulator and on iphone and it was working properly, but when i uploaded it. It started crashing again on startup for existing app users.


There is no crash log on itunes.


To test this issue i created another version of data model and followed this approach to test model versioning. It worked properly. App is crashing on start up so i guess change in data model is the reason. But i am not sure why is it crashing after adding appropriate options(Lightweight migration).




Aucun commentaire:

Enregistrer un commentaire