【问题标题】:XCode 9 Color Set Crashing the App in iOS 10 before didFinishLaunchingXCode 9 Color Set 在 didFinishLaunching 之前在 iOS 10 中使应用程序崩溃
【发布时间】:2018-03-15 10:29:55
【问题描述】:

新的 Xcode 9 有一个不错的功能 - 颜色设置。您可以使用名称为您的应用程序提供自定义颜色。然后,您可以在情节提要和代码中使用这些颜色集,也可以使用 UiColor 的 init?(named: String) 构造函数。

问题是这在 iOS 10 中不起作用。这将立即崩溃并显示消息 libc++abi.dylib: terminating with uncaught exception of type NSException

我多次尝试调试该应用程序。但我终于意识到问题出在 iOS 10 不支持的颜色集。

谁能告诉我是否为此提供了任何向后兼容性?因为,我想使用此功能,因为在调色板中使用自定义命名颜色而不是任意颜色是很好的。

【问题讨论】:

    标签: ios xcode storyboard xcode9


    【解决方案1】:

    我也有同样的问题,因为命名颜色在 iOS 10 上不可用,我用 Python 写了一个 shell,它可以在发布项目时替换 Storyboard 和 Xib 中的命名颜色。

    http://artwalk.github.io/2017/10/23/Batch-replace-NamedColors-to-RGB-in-Storyboard/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-29
      • 2016-10-20
      • 2018-03-07
      • 1970-01-01
      • 1970-01-01
      • 2019-03-02
      相关资源
      最近更新 更多