Xcode 数据模型编译器 - MOMC 错误:命令 momc 失败,退出代码为 1

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12102504/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 01:19:10  来源:igfitidea点击:

Xcode Data Model Compiler - MOMC Error: Command momc failed with exit code 1

iosxcodexcdatamodel

提问by emmandroid

I am having troubles integrating XMPP on my iOS Project using Xcode 4.4 under Mac Mountain Lion OS X. I followed every step but I got stuck with this problem:

我在 Mac Mountain Lion OS X 下使用 Xcode 4.4 在我的 iOS 项目上集成 XMPP 时遇到了麻烦。我遵循了每一步,但我遇到了这个问题:

Command momc failed with exit code 1

命令 momc 失败,退出代码为 1

See screenshot:

看截图:

I have deleted all the .xcdatamodel files, clean and re-build the project, but the error is still there.

我已经删除了所有 .xcdatamodel 文件,清理并重新构建项目,但错误仍然存​​在。

回答by emmandroid

Ok. Solved it. You have to delete the *.xcdatamodel files on the Xcode project. (Right click > Delete).

好的。解决了。您必须删除 Xcode 项目中的 *.xcdatamodel 文件。(右键单击 > 删除)。

回答by szotp

Check if you have empty .xcdatamodel folders inside .xcdatamodeld. This may happen due to git behaviour for example.

检查 .xcdatamodeld 中是否有空的 .xcdatamodel 文件夹。例如,这可能由于 git 行为而发生。

回答by shuiyouren

Maybe the problem is iOS/iOS Simulator version! If you don't delete the *.xcdatamodel for git, you can try replace iOS/iOS Simulator SDK or update. My problem is resolved in this way.

可能是iOS/iOS模拟器版本的问题!如果不删除 git 的 *.xcdatamodel,可以尝试更换 iOS/iOS Simulator SDK 或更新。我的问题就是这样解决的。

enter image description here

在此处输入图片说明

回答by Mohammad Parvez

Face the same problem

面临同样的问题

I just created new model with new name and copy all the entity from old model and paste in new model and deleted old model, it worked

我刚刚用新名称创建了新模型,并从旧模型中复制了所有实体并粘贴到新模型中并删除了旧模型,它起作用了

回答by Jeremie D

This also can happen when the project is first compiled on a newer version of xCode (beta versions for example) and then trying to recompile with the original version.

当项目首先在较新版本的 xCode(例如 beta 版本)上编译,然后尝试使用原始版本重新编译时,也会发生这种情况。