Get our help adding Core Data to your project So, with your existing project open, create a new project in Xcode (⇧⌘N) and select a Single View App, you can call it whatever you like as we'll be deleting it when we're done. You'll see the “Use Core Data” checkbox on the project options screen, make sure it is checked.
You can delete a data model from the Data Model management page or the Data Model Editor. Just click Edit and select Delete. Note: If your role grants you the ability to create data models, it should grant you the ability to delete them as well.
Migrations happen in three steps: First, Core Data copies over all the objects from one data store to the next. Next, Core Data connects and relates all the objects according to the relationship mapping. Finally, enforce any data validations in the destination model.
In Xcode 4, if you only see one version of your data model under the "Versioned Core Data Model - Current" section of the file inspector when you have your *.xcdatamodeld file selected; or you have a 2nd version of your *.xcdatamodel file showing outside of the xcdatamodeld bundle in Xcode's project navigator, read below.
To fix this:
1) Remove both both the *.xcdatamodeld and *.xcdatamodel references from Xcode by right clicking on them in the project navigator and hitting "Delete".
2) When prompted by Xcode, click Remove References Only (very important).
3) Restart Xcode for good measure in case there is any caching going on.
4) Re-add the single *.xcdatamodeld file that contains both *.xcdatamodel files.
Xcode should now recognize the relationships and allow you to expand the *.xcdatamodeld file in the project navigator to show both *.xcdatamodel files under the parent xcdatamodeld bundle, also showing a green checkmark next to the current model. This should also allow you to select the current version of the data model in the file inspector instead of only showing one version.
For Xcode 4.2
Click on YourModel.xcdatamodeld
Make the side pane visible
Under "versioned core data model", select the "current drop down box", select you data model.
Now the green tick mark is moved to your current data model.
Searching in Xcode's Help for "Current Version" yields a recipe "Setting a Managed Object Model’s Current Version" which describes how to do this...
A little off topic, but if you've reached this question in order to know how to create a first new version of your model (like i did) : click on the xcdatamodel file >> Menu "Editor" >> Add Model version
This will initiate the versionning of the model.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With