Frage

I have an app using Core Data, it's the first version of the app. Before upload this first version to App Store, should i make some preparation to future changes in my xdatamodeld? Or i only need make the versioning of the model on future app versions that has changes in the model?

War es hilfreich?

Lösung

You're fine to submit as is, but I usually make sure I have an identifier provided for a model (select your model, check the file inspector). When you change the model in the future you'll do something like:

  1. Select the *.xcdatamodelId
  2. Select Editor > Add Model Version
  3. Provide a version name based on the previous model
  4. Make sure you select the new version you just created
  5. Give it a new identifier (in the file selector)
  6. Make your changes
  7. Select the *.xcdatamodelId and change the Model Version (in the file selector)

Now you want to test. Switch to your previous version, install, and run. Switch to your new version and run that. Did you crash on launch? If so something is wrong, otherwise you're good to go.

You want to make sure your migration to the new version happen regardless of what model version someone is coming from.

Reading materials:

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top