问题
Installed Xcode 4 and it all seems fine... except, when I try to add versioning to a Core Data model. In the instructions it says I should select the data model in the navigator and then "Choose Editor > Convert to Versioned Model." Well, the "Editor" menu does not have an item "Convert to Versioned Model"!!! Skipping this step crashes XCode 4. Also, I can't believe that there is no support for XCode 4 now that it is a pay product! Any ideas?
回答1:
There are currently several issues with the core data model editor in Xcode4. I highly recommend installing Xcode3 next to Xcode4 and doing all of your model work in Xcode3 until these issues are addressed.
I also recommend filing a radar so that you can add your voice to this issue.
回答2:
First select your xcdatamodeld file and go to the Editor Menu and select the Add Model Version option. After you create your new version select again the xcdatamodeld file and be sure you have the Utilities sidebar shown and select the first icon, the File Inspector one. You will have a Versioned Data Model option.
Hope that was what you were looking for.
回答3:
I had the same issue with xcode 4.5. And after some time I have resolved it:
- Move my test.xcdatamodel file to the root in the project navigator.
- Highlight file in a new location and select Editor -> Add Model Version...
And xcode automatically creates *.xcdatamodeld with two files : 'test 2.xcdatamodel' and 'test.xcdatamodel'. And 'test 2.xcdatamodel' is marked as current version.
来源:https://stackoverflow.com/questions/5331268/xcode-4-data-model-versioning-bug