xcode .xcdatamodel: cdtool 无法编译

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31849881/
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 07:38:00  来源:igfitidea点击:

.xcdatamodel: cdtool cannot compile

xcodecore-data

提问by polarware

This problem occurred right after the last update of OS X El Capitan 10.11 beta 6, Xcode 7 beta 4 compiles my projects with the error in .xcdatamodel file saying: cdtool cannot compile. I tried to compile the same projects on OS X Yosemite and with Xcode 7.0 beta 4 I get always the same compilation error. Any idea on how to clear this issue? I'd appreciate any help.

这个问题发生在 OS X El Capitan 10.11 beta 6 的最后一次更新之后,Xcode 7 beta 4 编译我的项目,在 .xcdatamodel 文件中出现错误说: cdtool cannot compile。我试图在 OS X Yosemite 上编译相同的项目,但使用 Xcode 7.0 beta 4 我总是得到相同的编译错误。关于如何解决这个问题的任何想法?我很感激任何帮助。

采纳答案by Morgan Wilde

One solution posted on the Apple developer forums is renaming a file within the iOS Simulator.

发布在 Apple 开发者论坛上的一个解决方案是在 iOS 模拟器中重命名文件。

cd /Applications/Xcode-beta.app
cd Contents/Developer/Platforms/iPhoneSimulator.platform  
cd Developer/SDKs/iPhoneSimulator.sdk/usr/lib  
sudo mv dyld_sim dyld_sim.orig

Here's the original link.

这是原始链接

回答by CodenameDuchess

This solution unfortunately did not work for me. However, I had recently changed some tables around in core data. I found the culprit by looking at all of my relationships and their inverses. One of the inverses had a dead reference. Switched it to "no inverse" did a clean and was up and running again. Hope this helps someone else. enter image description here

不幸的是,这个解决方案对我不起作用。但是,我最近更改了核心数据中的一些表。我通过查看我所有的关系及其倒数找到了罪魁祸首。其中一个倒数有一个死参考。将其切换为“无反向”进行了清理并再次启动并运行。希望这对其他人有帮助。 enter image description here

回答by Chris Garrett

I got this error when I changed the name of a property that was being used in a fetched property predicate. (So the predicate could no longer compile)

当我更改在获取的属性谓词中使用的属性的名称时出现此错误。(因此谓词无法再编译)

Fixing the typo in the predicate and rebuilding the project fixed the error.

修复谓词中的错字并重建项目修复了错误。

回答by Romulo BM

In my case, I got this error because of wrongly configured Constraints for properties. I'm not sure about what was wrong, but remove and re-add the constraints, the error disappear.

就我而言,我收到此错误是因为错误地配置了属性的约束。我不确定出了什么问题,但是删除并重新添加约束,错误消失了。

Obs: When i say constraints for properties, i'm telling about this:

Obs:当我说属性约束时,我是在说这个:

enter image description here

enter image description here