Xcode 4.1 (Lion) 和 Xcode 3.2.5 (snow leopard) 之间 .xcdatamodeld 的兼容性问题
我对使用核心数据的数据模型有疑问。
1/ 我已经在 xcode 4.1(在 lion 上)上使用我的实体及其关系创建了一个数据模型。在右侧的检查器中,我检查了“工具版本”:最低:Xcode 3.2 而不是 Xcode 4.1。
2/当我尝试重新打开我的项目时,在 Xcode 3.2.5(在雪豹上)中,我单击“mydatamodel.xcdatamodeld”,然后单击“mydatamodel.xcdatamodel”,但没有任何反应!就像我的 xcdatamodel 文件是空的,但它是 4.9 Mo 文件!我的 xcdatamodel 文件拒绝打开,这非常令人沮丧。
3/ 我尝试仅添加 xcdatamodel 文件,该文件位于 xcode 3.2.5 上的 xcdatamodeld 文件夹中,但它会导致 Xcode 崩溃。
4/我尝试在xcode 3.2.5(在雪豹上)上创建“test.xcdatamodel”,并将粘贴文件“elements”和“layout”从“mydatamodel.xcdatamodel”(在lion上的Xcode 4.1上创建)复制到“test.xcdatamodel”但同样的事情,数据模型拒绝打开!
如果有人能帮助我,那就太好了!
I have a problem with a Data Model using Core Data.
1/ I've created a data model on xcode 4.1 (on lion) with my entities and their relationships. In the inspector on the right i've checked "Tools version" : Minimum : Xcode 3.2 instead of Xcode 4.1.
2/ When i try to reopen my project, in Xcode 3.2.5 (on snow leopard), I click on "mydatamodel.xcdatamodeld", then on "mydatamodel.xcdatamodel", but nothing happen ! It's like my xcdatamodel file was empty but it's a 4.9 Mo file ! My xcdatamodel file refuses to open and it's very frustrating.
3/ I've tried just to add only the xcdatamodel file which is in the xcdatamodeld folder on xcode 3.2.5 but it's generating a crash of Xcode.
4/ I've tried to create "test.xcdatamodel" on xcode 3.2.5 (on snow leopard) and to copy paste files "elements" and "layout" from "mydatamodel.xcdatamodel" ( created on Xcode 4.1 on lion) to "test.xcdatamodel" but same thing, the data model refuses to open !
If anyone can help me, it will be great !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
.xcdatamodel 包的格式在这 2 个 Xcode 版本之间发生了变化。元素和布局的格式现在是基于 xml 的,而它们曾经是二进制数据。
您可以在文件检查器中更改 .xcdatamodel 文件所需的最低 Xcode 版本。
The format of .xcdatamodel bundles was changed between these 2 versions of Xcode. The format of the elements and layout are now xml based, whereas they used to be binary data.
You can change the minimum required Xcode version in the file inspector for your .xcdatamodel file.
XCode 4.1 适用于 Snow Leopard。我建议您尝试在两台机器上使用相同的版本。
XCode 4.1 is available for Snow Leopard. I suggest you just try using the same version on both machines.
使用最新的 XCODE ver 4.2 更可靠。与 lion (OSX 10.7) 兼容。有 ARC、故事板等令人惊叹的功能。
It is more reliable to use latest XCODE ver 4.2. Compatible with lion (OSX 10.7).There are amazing features like ARC,storyboard and much more.