Deleting core data version xcdatamodel files Deleting core data version xcdatamodel files ios ios

Deleting core data version xcdatamodel files


Deleting the old models means you cannot migrate any existing data stores. I assume you're ok with that given your statement about data loss. If you want to start fresh, you can take the current xcdatamodel, copy it somewhere else (e.g. your Desktop), then delete the xcdatamodeld folder. At this point, you can drag your saved xcdatamodel back into Xcode and re-add it as a non-versioned file.


If you want to get rid of old versions of the data model

(Note: make sure you copy the Data model file and save it somewhere in case something goes wrong)

Five Step solution

  1. Select .xcdatamodeld file in Xcode, make sure you have the latestversion is set as the current data model.
  2. Right, Click Show in finder if you don't see all your versions rightclick again and show package contents.
  3. Delete all the version except the latest.
  4. Jump back to Xcode and now delete the .xcdatamodeld file just removereference don't move to trash.
  5. Add the file back again

Voila it's done