gpt4 book ai didi

swift - 如何修复警告 "CoreUI: RunTimeThemeRefForBundleIdentifierAndName() couldn'找不到与标识符: '(null)' "?捆绑在一起的Assets.car

转载 作者:行者123 更新时间:2023-12-04 12:26:32 28 4
gpt4 key购买 nike

我正在尝试在iOS 13 Beta上测试应用程序。当我在欢迎屏幕上点击一个按钮以切换到另一个屏幕时,该应用程序卡住,然后终止。当我在Xcode 11中进行调试时,在控制台中看到以下警告行:

[framework] CoreUI: RunTimeThemeRefForBundleIdentifierAndName() couldn't find Assets.car in bundle with identifier: '(null)'

[framework] CoreUI: RunTimeThemeRefForBundleIdentifierAndName() couldn't find Assets.car in bundle with identifier: '(null)'


然后几秒钟后,应用程序终止并显示日志条目:

Message from debugger: Terminated due to memory issue


在iOS 12上没有这样的问题。我用几个 Assets 文件创建了一个简单的测试应用程序,并且按钮点击时的顺序运行良好。另外,我将目标版本更改为iOS 13,更改了捆绑包标识符,进行了清理和重建,但问题仍然存在。

最佳答案

我发现问题与

CoreUI: RunTimeThemeRefForBundleIdentifierAndName() couldn't find Assets.car in bundle with identifier: '(null)'



在目标屏幕上使用了自定义UILabel。应用程序卡住和内存问题的根本原因是方法之间的可重入循环
override var text: String? {
didSet {
guard let text = text else { return }
let textRange = NSMakeRange(0, text.count)
// Kern attribute needed to do letter spacing over text
let attributedText = NSMutableAttributedString(string: text)
attributedText.addAttribute(NSAttributedStringKey.kern , value: 2.0, range: textRange)
// Add other attributes if needed
self.attributedText = attributedText
}
}


override public func layoutSubviews() {
super.layoutSubviews()
if let text = self.text {
self.text = text.uppercased()
}
}
attributedText字段更改后,可能新的SDK版本会调用layoutSubviews()

关于swift - 如何修复警告 "CoreUI: RunTimeThemeRefForBundleIdentifierAndName() couldn'找不到与标识符: '(null)' "?捆绑在一起的Assets.car,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57912288/

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