Xcode数据模型编辑器没有出现 [英] Xcode Data Model Editor not appearing
问题描述
我正在使用Xcode 4.2而我正在尝试使用Core Data。单击.xcdatamodeld文件后,我看到一个奇怪的视图而不是数据模型编辑器视图。
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.
我重新安装了Xcode 4.2,甚至从头开始创建了一个启动Core Data的启动项目,但问题仍然存在。当我使用新文件 - >数据模型创建数据模型时。它未被识别为DataModel。 Ctrl +单击 - >'打开为'仅显示预览选项。我将我的基本项目与在不同机器上创建的项目进行了比较(一切正常)。目录差异显示:
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 :
-
Foos.xcdatamodeld文件位于项目构建阶段的复制包资源部分下而不是在编译源部分。我将此文件移至编译源部分,但数据模型编辑器仍未显示。
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.
Foos / Foos.xcdatamodeld / .xccurrentversion文件在工作项目中看起来像
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>
在非功能性货币中它是
<?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>
- 我注意到的另一个不同之处是工作版在project.pbxproj文件中有以下内容
/* 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.
我在两台机器上进行了/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates的目录比较,模板完全相同。
I did a directory compare of /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates on my two machines and the templates are identical.
所以我想知道Xcode的哪个部分导致了我的主要开发机器上面的差异。关于要尝试的事情或可能导致此问题的任何建议?
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?
推荐答案
我遇到了类似的问题。问题是项目目录结构以及它在XCode中的配置方式。
I ran into a similar issue. The problem was the projects directory structure and how it was configured in XCode.
这里有更多细节: XCode Cant'编辑CoreData模型
这篇关于Xcode数据模型编辑器没有出现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!