【问题标题】:CoreData/Entity error does not disappear even though there is no more entity即使没有更多实体,CoreData/Entity 错误也不会消失
【发布时间】:2017-07-04 06:14:14
【问题描述】:

我面临CoreData 相关问题,并且不断收到此错误消息:

Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

更准确地说,在上面的消息显示之前,我可以看到这些细节:

<unknown>:0: error: filename "NiceEntity+CoreDataProperties.swift" used twice: '../Library/Developer/Xcode/DerivedData/NiceApp-bactemnueukiynkkjghppujjxzyht/Build/Intermediates/NiceApp.build/Debug-iphonesimulator/NiceApp.build/DerivedSources/CoreDataGenerated/BWP/NiceEntity+CoreDataProperties.swift' and '../Library/Developer/Xcode/DerivedData/NiceApp-bactemnueukiynkkjghppujjxzyht/Build/Intermediates/NiceApp.build/Debug-iphonesimulator/NiceApp.build/DerivedSources/CoreDataGenerated/BWP/NiceEntity+CoreDataProperties.swift'
<unknown>:0: note: filenames are used to distinguish private declarations with the same name

我知道我在第一次设置实体 NiceEntity 时做了一些错误的操作,但我已经删除了我可以看到的与该实体相关的所有内容。那就是我从数据模型中删除了实体 NiceEntity 并删除了 DerivedData/NiceApp-bactemnueukiynkkjghppujjxzyht 文件夹。然而错误并没有消失。

有人知道如何解决这个问题吗?

如果这可能有用,我使用的是 Xcode 版本 8.3.2。

【问题讨论】:

  • 如何删除派生文件夹有时也很重要。您必须先打开派生数据文件夹,然后退出 xcode,然后才能删除该文件夹。
  • 我刚刚在退出 Xcode 后通过删除 DerivedData/NiceApp-bactemnueukiynkkjghppujjxzyht 文件夹(从终端)再次尝试,但它没有改变任何东西。问题依然存在。

标签: ios core-data swift3


【解决方案1】:

我建议您在模拟器中再次“重置内容和设置”以确保您再次拥有一个干净的基础。 另外清理构建文件夹

希望对你有帮助, 干杯glnj

【讨论】:

  • 在模拟器中再次“重置内容和设置”是什么意思?我没有使用模拟器。我只是想编译和构建。而且我几乎总是清理构建文件夹。这仍然不起作用。
  • 查看这篇文章应该对您有帮助 stackoverflow.com/questions/38190360/… Cheers nj PS 重置内容和设置选项适用于模拟器,如果我们更改任何实体,我们通常会重置它。
【解决方案2】:

这是最后对我有用的方法。

我删除了我最近添加的所有实体,即在某些方面与我的问题相关的实体。然后我一个一个地重建它们(我很幸运没有太多),问题神奇地消失了。谁知道我以前做过什么肮脏的事情?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-02-14
    • 1970-01-01
    • 2016-12-15
    • 2022-01-21
    • 2014-04-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多