3

I have now >45 different versions of xcdatamodel in Xcode, of which 44 of them are no longer required, as I've eseentially gone for the drop/create approach of the entire database. How can I clear these out, without Xcode kicking up a fuss?

See the linked image:

https://www.dropbox.com/s/1bpdhf9bax6iicb/Screenshot%202014-05-23%2013.24.45.png

idmean
  • 14,540
  • 9
  • 54
  • 83
David van Dugteren
  • 3,879
  • 9
  • 33
  • 48
  • Don't believe there's much reason to version in development, other than practice. Consider store options `NSMigratePersistentStoresAutomaticallyOption` and `NSInferMappingModelAutomaticallyOption` if you were getting annoyed at blowing away the store every time you made a model tweak. – stevesliva May 23 '14 at 04:17
  • possible duplicate of [Deleting core data version xcdatamodel files](http://stackoverflow.com/questions/6712123/deleting-core-data-version-xcdatamodel-files) – jrturton May 23 '14 at 07:35

1 Answers1

6

Note: this approach is waaaaayyyy simpler: https://stackoverflow.com/a/6712191/84783, but if you wanna get up to your elbows with project files, try my steps below.


I think they keep these around for current installations to do model migrations. Sadly I think you have some manual project file hacking.

  • Make sure you have the model you want set as the current model
  • Close Xcode
  • Right click on "Model.xcdatamodeld" in Finder
  • Choose Show Package Contents
  • Delete the models you no longer want
  • Right click on "MyProject.xcodeproj"
  • Choose Show Package Contents
  • Open project.pbxproj in a text editor
  • Search for ".xcdatamodel" and delete entries (Model.xcdatamodel and "Model X.xcdatamodel") no longer in use
  • Careful not to delete ".xcdatamodeld" files

Hope this helps, Rob

Community
  • 1
  • 1
rob5408
  • 2,972
  • 2
  • 40
  • 53