0
votes

I am using lightweight migration for core data versioning in my iPhone application, and i add new model version to core data and set this new version as a current version, then i start adding new attributes to the NEW model version, and i release the app for app store.

When users update the application it crash and never run.

I find the cause of the crash, which is when i add the attributes to new version model, these attributes also added to the previous model version, so when users updated the application, lightweight migration does not work correctly since the version in users application does not match that version in the update application.

My question is: how this issue happens ? why Xcode add the new attributes to previous model and current model instead of adding it to current model only?

1
You do create a new data model version in XCode, right? - mprivat
Yes exactly, i create the data model version in xcode - Ayman Melhem
Did you pass options that enable lightweight migrations for the store coordinator? - Eimantas
Yes I did, the problem is when i add new attributes to new data model version, these attributes added also to the previous data model version, and the result is the new attributes are exist in both new model version and the previous model version - Ayman Melhem
I mean, in Xcode. Select the data model and Editor->Add Model Version. It should create a new file. There's no reason it would add it to the previous version (the other files), they are two physically different files. Feel free to post a screenshot. - mprivat

1 Answers

0
votes

May me some error occurred while Xcode linking core data models files