Search code examples
iphoneioscore-datacore-data-migrationxcdatamodel

iOS - what is the right way to deal with a data model change?


I already have an app in the app store. I want to do an upgrade. My local data store has changed, with an extra table, and with a few fields added in the existing table. I want to retain the data in the old tables. How would I go about doing that? Could someone point me to tutorials that handle that kind of change?


Solution

  • Check out Apple's docs on migrating a core data instance. They make it super easy for 90% of the cases. The basic idea, is you break you xdatamodel into versions, so it has a path for migration

    Here's a tutorial that might help you Core Data Migration