首页 > 解决方案 > IBUIColor.m 中的断言失败 - Xamarin.iOS

问题描述

突然之间,我的 Xamarin iOS 项目没有构建。我上次提交的 Storyboard 版本正在运行,但文件中的任何细微更改都会产生以下错误。

MainController.storyboard : error : 2019-11-19 19:53:33.159 ibtoold[9510:345883] [MT] DVTAssertions: ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEInterfaceBuilder/IDEInterfaceBuilder-15505/InterfaceBuilderKit/ImageCatalog/Library/IBUIColor.m:105

MainController.storyboard : error : Details:  nsColor should be an instance inheriting from NSColor, but it is IBUIColor

MainController.storyboard : error : Object:   <IBUIColor: 0x7fd6420a5290>

MainController.storyboard : error : Method:   -initWithNSColor:

这是完整的日志:https ://del.dog/obapeletof

这是完整的 xcode 崩溃日志:https ://del.dog/oyibarutoc

如果我尝试在 xcode 中打开文件,它会产生相同的错误并导致 xcode 崩溃。我现在真的不知道是什么导致了错误。我尝试在 xml 格式的 Storyboard 中搜索 nscolor,但没有!

标签: xcodexamarinxamarin.iosvisual-studio-mac

解决方案


Xamarin iOS 设计师出于某种原因从 StoryBoard 资源中删除了我下面的自定义颜色资产

<namedColor name="lightdarkcolor">
        <color colorSpace="custom" customColorSpace="sRGB" red="0" green="0" blue="0" alpha="1" />
</namedColor>

我不得不手动将它添加到后面的情节提要代码中。似乎 xamarin ios 设计师正在为每个项目使用颜色资产(可能在最近更新之后)。


推荐阅读