[Core Data small tips] How to remove a Data Model Version in Xcode.

尝试写一篇纯英文的。

How to remove a Data Model Version in Xcode.

When you need to migration data model, you will create lots of data model version.

You will know that it is easy to create a data model veresion. But it is hard to find a way to delete one when it's useless for you.

here present a way to delete a data model version:

  1. right-click your .xcdatamodeld file in xcode files inspector, select the show in finder, and you will your .xcdatamodeld file in finder.

  2. Next, right-click the .xcdatamodeld file and select Show Package Contents, then you can see all you data model version.

  3. Back to Xcode, delete the reference of your .xcdatamodeld file, (remember just to delete the refreence, but to move to trash).

  4. Remove the data model version you didn't want anymore in finder.

  5. Add the .xcdatamodeld file back to your project in Xcode.

Then you got a new .xcdatamodeld file without the data model version you want to delete.

你可能感兴趣的:([Core Data small tips] How to remove a Data Model Version in Xcode.)