“数据模型版本编译"...升级到 Lion (Xcode4.1) 后出错 [英] "Data Model Version Compile".. error after upgrading to Lion (Xcode4.1)

查看:33
本文介绍了“数据模型版本编译"...升级到 Lion (Xcode4.1) 后出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从昨天升级到 Lion (10.6->10.7) 以来,我一直无法编译一个在升级前编译没有问题的项目.

Since upgrading to Lion yesterday (10.6->10.7), I've been unable to compile a project that had no problems compiling prior to the upgrade.

导致此错误的甚至不是最近对项目的更改:如果我从 SVN 签出几天或一周前的项目版本,则在构建时会遇到相同的错误:

It's not even a recent change to the project that's causing this error: If I checkout from SVN a version of the project from a few days or a week ago, I get the same error whilst building:

Command/Developer/usr/bin/momc failed with exit code 6",展开如下:

DataModelVersionCompile /Users/ian/Library/Developer/Xcode/DerivedData/inventory-gtvznzuhomhlakbdpocaqwnrihhx/Build/Products/Debug-iphonesimulator/inventory.app/inventory.momd inventory/inventory.xcdatamodeld
cd /Users/ian/AppsDev/uk.co.isurvey-inventory/ios/inventory/trunk/inventory
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/usr/bin/momc -XD_MOMC_SDKROOT=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -XD_MOMC_IOS_TARGET_VERSION=4.3 -MOMC_PLATFORMS iphonesimulator -MOMC_PLATFORMS iphoneos -XD_MOMC_TARGET_VERSION=10.6 /Users/ian/AppsDev/uk.co.isurvey-inventory/ios/inventory/trunk/inventory/inventory/inventory.xcdatamodeld /Users/ian/Library/Developer/Xcode/DerivedData/inventory-gtvznzuhomhlakbdpocaqwnrihhx/Build/Products/Debug-iphonesimulator/inventory.app/inventory.momd

2011-07-21 19:24:44.954 momc[4436:a0b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSXMLDocument initWithData:options:error:]: nil argument'
*** First throw call stack:
(
0   CoreFoundation                      0x00007fff8e411986 __exceptionPreprocess + 198
1   libobjc.A.dylib                     0x00007fff8d0d5d5e objc_exception_throw + 43
2   CoreFoundation                      0x00007fff8e4117ba +[NSException raise:format:arguments:] + 106
3   CoreFoundation                      0x00007fff8e411744 +[NSException raise:format:] + 116
4   Foundation                          0x00007fff8c761310 -[NSXMLDocument initWithData:options:error:] + 89
5   momc                                0x0000000102f04a2c momc + 10796
6   momc                                0x0000000102f04fe8 momc + 12264
7   momc                                0x0000000102f058f0 momc + 14576
8   momc                                0x0000000102f03d20 momc + 7456
9   ???                                 0x000000000000000a 0x0 + 10
)
terminate called throwing an exception
Command /Developer/usr/bin/momc failed with exit code 6

进一步解释:

AFAIK,唯一的区别是我现在使用的是 Lion,以及 Xcode 4.1 的 Lion 版本(在此之前我使用 Xcode 4.1 for Snow Leopard).

Further explanation:

AFAIK, the only difference is that I'm using Lion now, and the Lion version of Xcode 4.1 (where I was using Xcode 4.1 for Snow Leopard prior to this).

我已经删除了/Developer/,我已经重新安装了几次,并重新下载了 App Store Xcode 安装程序,以防它损坏.

I've deleted /Developer/ , I've reinstalled several times, and re-downloaded the App Store Xcode installer too, in case it was corrupt.

如果我使用 Xcode 创建一个项目(并使用 Core Data,我认为这与构建我的项目的任何问题有关),它构建并运行良好:也许我需要做些什么来修复我的真实项目?

If I create a new project using Xcode (and use Core Data, I think that's related to whatever problem there is building my project), it builds and runs fine: maybe there's something I need to do to fix my real project?

任何建议都会很棒!干杯,伊恩

Any suggestions would be brilliant! Cheers, Ian

推荐答案

我遇到了同样的问题,OS X Lion 10.7.1,Xcode 4.1.

I've had the same issue, OS X Lion 10.7.1, Xcode 4.1.

通过从 *.xcdatamodelid 目录中删除所有未在 Xcode 中显示的 *.xcdatamodel 目录来解决问题.这些目录出现在 Xcode 中 *.xcdatamodel 重命名之后.

The problem is solved by removing all *.xcdatamodel directories that are not displayed in Xcode from your *.xcdatamodelid directory. These directories appear after *.xcdatamodel renaming in Xcode.

可以在终端中通过 Finder 中的显示包内容"菜单或右键单击 Xcode 中的 xcdatamodel 并选择在 Finder 中显示"来完成删除.

Removing may be done in Terminal, by "Show package contents" menu in Finder or by right-clicking on xcdatamodel in Xcode and selecting "Show in Finder".

这篇关于“数据模型版本编译"...升级到 Lion (Xcode4.1) 后出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆