gpt4 book ai didi

swift - 为什么我的应用程序会因为 ibShadowedLargeTitleTextAttributes 错误而在启动时崩溃?

转载 作者:行者123 更新时间:2023-11-28 05:40:01 25 4
gpt4 key购买 nike

我正在为 iOS 构建一个应用程序并使用 Storyboard 作为 UI。我正在使用传统的 UINavigationController 及其类。标题是 prefersLargeTitles,标题颜色是我创建的命名颜色。当我在 iOS 13 上运行该应用程序时,它运行得非常好,但是当我在 iOS 12 上运行它时,它在启动时崩溃并返回错误:

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ valueForUndefinedKey:]: this class is not key value coding-compliant for the key ibShadowedLargeTitleTextAttributes.'

我没有弄乱 ibShadowedLargeTitleTextAttributes

我尝试了 this Stack Overflow question 中提供的一些解决方案,但是,它们都不起作用。即使我删除了导航 Controller 并将标题设置为标准(不是大标题),问题仍然存在。

我希望该应用程序能够在所有操作系统上顺利运行,因为我并没有真正更改 Storyboard 中的任何选项。不过,我在启动 Xcode 时确实遇到了一个弹出窗口:

Title: The document "Main.storyboard" had an internal inconsistency that was found and repaired.

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

Details: Multiple resources have the same name: POBlue ← That is the name of my named color.

崩溃可能是由什么引起的?可能是因为命名的颜色或其他我没有意识到的原因?

最佳答案

我遇到了同样的问题,然后这样解决了......

在文本编辑器中打开 .storyboard 文件,您会在底部看到 <resources>标签

<resources>内, 你可能会发现类似

<namedColor name="POBlue">
<color red="xxx" green="yyy" blue="zzz" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="POBlue">
<color red="xxx" green="yyy" blue="zzz" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>

删除一个 POBlue条目并保存文件。

再次在Xcode中打开,错误应该消失了

关于swift - 为什么我的应用程序会因为 ibShadowedLargeTitleTextAttributes 错误而在启动时崩溃?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57125860/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com