Xcode 显示 "The document had 4 issues that were found and repaired./Multiple resources have the same name: groupTableViewBackgroundColor."警报

标签 xcode xcode-storyboard xcode12

如果我在 Xcode 项目中打开其中一个 Storyboard,我会收到此警报:
"The document [storyboard name] had 4 issues that were found and repaired." error alert

The document [storyboard name] had 4 issues that were found and repaired.

This may be due to an SCM operation such as merging. Please save the document to fix the issues.


Multiple resources have the same name: groupTableViewBackgroundColor.


我尝试保存文档,但错误不断弹出。
这是什么,我该如何解决?

最佳答案

这个错误看起来像是一个 Xcode 错误,因为我不记得我的 Storyboard有合并问题。它可以通过编辑 Storyboard的源代码来修复。您可以这样做:

  • 在项目导航器中右键单击您的 Storyboard并选择 打开为/源代码 .

  • Open As/Source Code
  • 按 Cmd+F 在文件中搜索以下术语:<systemColor name="groupTableViewBackgroundColor">
  • 删除所有实例。我有 5 个颜色实例,名为 groupTableViewBackgroundColor因为某些原因。由于 Storyboard是基于 XML 的,因此定义以 </systemColor> 结尾。 :
    <systemColor name="groupTableViewBackgroundColor">
        <color red="0.94901960784313721" green="0.94901960784313721" blue="0.96862745098039216" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
    </systemColor>
    
  • 再次右键单击该文件,选择 Open As/Interface Builder - Storyboard 并且错误应该消失。

  • 如果错误仍然存​​在,删除并重新添加 Storyboard文件 .

    关于Xcode 显示 "The document had 4 issues that were found and repaired./Multiple resources have the same name: groupTableViewBackgroundColor."警报,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64344102/

    相关文章:

    Xcode, SpriteKit : How do you incorporate complex animations

    xcode - 如何解决Xcode错误: no such file or directory: fishhook.c?

    ios - Xcode: Storyboard更改演示

    c++ - 检查互联网连接或不断检查互联网连接

    ios - 添加 Flurry 库后的链接器错误

    ios - 如何更改 Xcode Storyboard中的预览设备?

    ios - 所有 View 看起来都已被选中

    ios - Xcode 12.2 测试版 3 : ld: unknown option: -no_adhoc_codesign

    使用 Firebase pod 的 Xcode 12。词法或预处理器问题。 "pb.h' 文件未找到 <angled> 包含;使用 "quotes"代替”?

    ios - 在 Mac 上使用 SwiftUI App Lifecycle 时,@UIApplicationMain 只能用于 'class' 声明错误