MOMC error with XCode4 and Data Model Compile

旧时模样 提交于 2019-12-21 03:42:27

问题


Whenever I build my project, I'm getting the error:

Command /Developer/usr/bin/momc failed with exit code 1

I've read posts here about deleting extraneous Data Model versions as a fix, and nothing works. I'm stumped because nothing changes the behavior of my Build: It always fail with the above error code, regardless of whether I actually have CoreData model files or not.

What I did to cause this error: Switched to a versioning model

What I tried:

  • Removing new version of Data model
  • Removing any old versions of Data model
  • Removing entire versioning model and using previous version from Git
  • Completely deleting any files or references to .xcdatamodel files (no coredata at all)

I've built clean between each attempt, and restarted XCode multiple times. Always the "exit code 1" error with momc.


回答1:


Open up the .pbxproj file and manually remove all references to .xcdatamodel. Re-open XCode, Build Clean....and then drop in your older version of .xcdatamodel




回答2:


For me the issue wasn't within the .pbxproj file.

Find the xcdatamodel file in finder. Option click and open package contents. Check to see if there are multiple versions inside that you don't recognise.

I was expecting only one version. A second version some how came about and xcode wasn't registering it.

I removed the second version and it's working fine now.



来源:https://stackoverflow.com/questions/7705206/momc-error-with-xcode4-and-data-model-compile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!