Lightweight migration not working. Error Domain=NSCocoaErrorDomain Code=134100

I am coding a new version of my app and it has a new store version. I add a new version of the model and set the Model version of the new model in the Inspector view of the model.


I added an options dictionary to addPersistentStoreWithType (as explained in the documentation of Lightweight migration)...


NSDictionary *options = @{NSMigratePersistentStoresAutomaticallyOption: @YES, NSInferMappingModelAutomaticallyOption: @YES};


But I am receiving the following error...


Error Domain=NSCocoaErrorDomain Code=134100 "The managed object model version used to open the persistent store is incompatible with the one that was used to create the persistent store.


Please suggest what I should do.

Answered by ace.neerav in 307818022

Yes. Just few attributes were added. The problem has been rectified. Turns out i added the migration options in the line of code which adds a persistent store for core data with icloud (old code) instead of a local store.

Have you verified that the changes you made to the object model fall within the limitations of lightweight migration?

Accepted Answer

Yes. Just few attributes were added. The problem has been rectified. Turns out i added the migration options in the line of code which adds a persistent store for core data with icloud (old code) instead of a local store.

Lightweight migration not working. Error Domain=NSCocoaErrorDomain Code=134100
 
 
Q