I'm using Xcode 4.2 and I'm trying to use Core Data. Upon clicking the .xcdatamodeld file I see a strange view instead of the Data Model Editor View.
I have reinstalled Xcode 4.2 and have even created a starter project from scratch with Core Data Enabled but the issue persists. When I create a Data Model using new file --> Data Model. It is not being recognized as a DataModel. Ctrl+Click --> 'Open As' only displays a "Preview" option. I compared my basic project with that created on a different machine (where everything works fine). A directory diff reveals :
The Foos.xcdatamodeld file was placed under the "Copy Bundle Resources" section of the project's Build Phase instead of being under the "Compile Sources" section. I moved this file to the "Compile Sources" section but the data model editor still doesn't display.
The Foos/Foos.xcdatamodeld/.xccurrentversion file in the working project looked like
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>_XCCurrentVersionName</key>
<string>Foos.xcdatamodel</string>
</dict>
</plist>
while in the non-functional one it was
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>
- The only other difference I noticed was that the working version had the following in the project.pbxproj file
/* Begin XCVersionGroup section */
831B12C114A7F73600524A33 /* Foos.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
831B12C214A7F73600524A33 /* Foos.xcdatamodel */,
);
currentVersion = 831B12C214A7F73600524A33 /* Foos.xcdatamodel */;
path = Foos.xcdatamodeld;
sourceTree = "";
versionGroupType = wrapper.xcdatamodel;
};
/* End XCVersionGroup section */
while the broken one did not have this entry.
I did a directory compare of /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates on my two machines and the templates are identical.
So I'm wondering what part of Xcode is causing the above differences on my primary dev machine. Any suggestions on things to try or what might be causing this issue?