views:

336

answers:

2

I have the latest version of Xcode and when I select my .xcdatamodel file and then select "Data Model" => "Add Model Version", I get the following dialog:

Internal Error

File: ... Line: ... Object: ... Method: ...

Couldn't create new version 'MyApp1 2.xcdatamodel' in version group 'MyApp1.xcdatamodeld'

=====================

It wiped out the old .xcdatamodel directory and created a new .xcdatamodeld directory, but there is nothing it it.

Fortunately I have an old copy of the original directory and I can restore it with little difficulty, but I need to update the schema in a way that will migrate old versions.

Any idea of how I can do this by hand?

A: 

This was happening to my project when the Project Format is set to Xcode 3.2-compatible. This setting is under the info window, Project Format drop down. I had changed it from the default, for not particular reason.

Setting it back to the default, Xcode 3.1-compatible, made the problem go away for me. I'm using 3.2.4 and the iOS 4.1 GM SDK.

logancautrell
A: 

I have the same problem, and the answer posted regarding project format didn't help.

I created a new core data xcode project, and noticed that the model in the new one is a file of type "xcdatamodeld" which can be expanded, and contains an "xcdatamodel" file ... however, in my project, I don't have the former, just the latter?!

Does anyone have any ideas how to convert my model, which seems to be in an old or screwed up format into one with a xcdatamodeld?

Steven
I solved this. I created a new project with core data. Copied the xcdatamodeld file to my desktop, renamed it to have the same name as my original xcdatamodel file (not changing the extension). Right click on it, show package contents, delete the xcdatamodel file inside it, replace it with my original xcdatamodel file. Go back to xcode, delete my xcdatamodel, delete it from the disk, replace with the xcdatamodeld. Phew.
Steven