ios - 如何在 IOS13 中找到这个与字体相关的 coretext 警告的来源?

标签 ios objective-c swift xcode core-text

在更新我的应用程序时,我注意到在 IOS13 上的 Xcode 11.2 中运行应用程序时,我在日志中收到大量警告。

CoreText note: Client requested name ".SFUI-Regular", it will get TimesNewRomanPSMT rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[UIFont systemFontOfSize:].



我挖了一下,发现了 WWDC 的这句话:

As mentioned in numerous WWDC sessions, dot-prefixed font names are not to be directly used.



我自己几乎完全使用 IB 和 nibs 来设置文本字段等的字体,并且在我的代码中的任何地方都没有提到“SFUI-Regular”,所以我不确定如何找到这些警告的实际原因(我有日志中有 20-30 行这样的内容)。

有没有人对我如何找到警告的来源以及如何解决它有任何提示?

最佳答案

控制台还有一个输出,可以尝试添加符号断点

CoreText note: Set a breakpoint on CTFontLogSystemFontNameRequest to debug.

关于ios - 如何在 IOS13 中找到这个与字体相关的 coretext 警告的来源?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58706570/

相关文章:

ios - 在 iOS UIView Swift 中为展开的绘图设置动画

ios - Objective-C 中 UILabel 的类型转换

ios - 检测 Secure Enclave 在当前设备上是否可用

objective-c - 类方法,其中 self 如果在 block 中使用

ios - ReactiveCocoa 中的 Map 或 flattenMap

swift - 仅接收来自过滤器的一项数据以构造

ios - 如何制作一个自定义的TableViewCell,每个TableViewCell都有不同的高度

ios - Cocos2d-x 应用程序仅在 Ad-hoc 构建中崩溃

ios - didEndEditingRowAt 未使用自定义 tableview 单元格调用

iOS leftSpacingConstraint 相对于屏幕高度