Xcode shows “The document had 4 issues that were found and repaired./Multiple resources have the same name: groupTableViewBackgroundColor.” alert

泪湿孤枕 提交于 2020-12-05 10:29:05

问题


If I open one of the storyboards in my Xcode project, I get this 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.

I tried saving the document, but the error kept popping up.

What is this and how can I fix this?


回答1:


This error looks like to be an Xcode bug, as I cannot recall having merge issues with my storyboard. It can be fixed by editing the storyboard's source code. Here's how you can do it:

  • Right click on your storyboard in the Project navigator and select Open As/Source Code.

  • Search for the following term in the file by pressing Cmd+F:

    <systemColor name="groupTableViewBackgroundColor">

  • Delete all instances. I've had 5 color instances named groupTableViewBackgroundColor for some reason. Since storyboards are XML-based, the definitions end with </systemColor>:

    <systemColor name="groupTableViewBackgroundColor">
        <color red="0.94901960784313721" green="0.94901960784313721" blue="0.96862745098039216" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
    </systemColor>
    
  • Right click again on the file, select Open As/Interface Builder - Storyboard and the error should go away.

If the error still persists, delete and re-add the storyboard file.



来源:https://stackoverflow.com/questions/64344102/xcode-shows-the-document-had-4-issues-that-were-found-and-repaired-multiple-re

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