Xib花费很长时间(> 1s)加载。 UIFont缓存似乎怪罪 [英] Xib taking long time (>1s) to load. UIFont cache seems to blame

查看:231
本文介绍了Xib花费很长时间(> 1s)加载。 UIFont缓存似乎怪罪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从一个Storyboard加载一个Xib,然后加载一个UIVC。这个内部负载导致VC花费超过一秒的时间来加载。在内部的xib中有一些奇特的步法(它载入另一个具有动态绘图的xib),但这似乎并不是瓶颈。根据仪器, UIFont -initWithCoder 是罪魁祸首。 (如果进一步钻取 TBaseFont :: CopyLocalizedName()是占1秒时间的最深入的项目)

我有点难住,因为我使用的自定义字体出现在整个应用程序没有问题。任何想法?



解决方案

好的问题是自定义字体不再嵌入到应用程序中。我已经转换到另外一个看起来一样的类似。奇怪,虽然我曾预料那些冒犯标签恢复在设备上的系统字体,但他们没有。是否有可能将他们从Macbook中拉出来?


I have a UIVC loading from a Storyboard which, in turn, loads a Xib. This inner load is causing the VC to take more than a second to load. There is some fancy footwork going on in the inner xib (it loads another xib which has dynamic drawing) but this doesn't appear to be the bottleneck.

According to Instruments, UIFont -initWithCoder is the culprit. (If you drill down further TBaseFont::CopyLocalizedName() is the deepest entry that accounts for the majority of the 1s time)

I'm a bit stumped as the custom font I use occurs all throughout the app with no problems. Any ideas?

解决方案

Ok the problem was that the custom font was no longer embedded in the app. I had switched to another similar one which looked the same. Weird though as I'd have expected those offending labels to revert back the System font on the device but they did not. Is it possible they were being pulled from the Macbook?

这篇关于Xib花费很长时间(> 1s)加载。 UIFont缓存似乎怪罪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆