ios - 我的应用程序在添加 Aller 字体系列的字体(如粗体、常规和斜体)时崩溃

标签 ios

我已将它们正确添加到我的 plist 中并创建了一个自定义 UIFont 类,我在其中使用此 Aller 字体覆盖系统字体。对于相同的代码和相同的过程,如果我集成 Lato 字体,它可以正常工作。问题仅在于Aller 字体。

il passed to [UILabel setFont:] and [UILabel defaultFont] is also nil. Don't know what to do, so leaving font as (null) 0.000000
2014-12-18 15:33:50.715 2497:72343] Unable to load string table file: CFBundle 0x7fcfcae121a0 </Users/arun/Library/Developer/CoreSimulator/Devices/8A7E96AE-E960-4DAF-BD6F-79E533711C63/data/Containers/Bundle/Application/50D90A3E-10C5-4E02-A0D3-A1AAA86508D8.app> (executable, loaded) / Main: The operation couldn’t be completed. (Cocoa error 3840.)
2014-12-18 15:33:50.735 [2497:72343] nil passed to [UIButton setFont:] and [UIButtonLabel defaultFont] is also nil. Don't know what to do, so leaving font as (null) 0.000000
2014-12-18 15:33:50.737 [2497:72343] nil passed to [UIButton setFont:] and [UIButtonLabel defaultFont] is also nil. Don't know what to do, so leaving font as (null) 0.000000
2014-12-18 15:33:50.737[2497:72343] nil passed to [UILabel setFont:] and [UILabel defaultFont] is also nil. Don't know what to do, so leaving font as (null) 0.000000
2014-12-18 15:33:50.742[2497:72343] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** setObjectForKey: object cannot be nil (key: NSParagraphStyle)'

最佳答案

这真是令人不安的情况。即使我花了很多时间研究解决方案。终于得到了一个专门针对像 Aller 这样的字体的解决方案,你可以尝试这个。它对我有帮助。 尝试通过在字体簿中打开字体文件来检查字体的正确名称,并使用其中显示的字体名称。

关于ios - 我的应用程序在添加 Aller 字体系列的字体(如粗体、常规和斜体)时崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27543957/

相关文章:

iphone - 如何从 SKScene 中执行 segue?

ios - 核心图形和数组

ios - 如何在字典数组中的内部数组上应用过滤器?

ios - xCode iOS Simulator 仅在横向时滞后

ios - 在 UISplitViewController 中,无法使 showDetailViewController :sender: push onto detail navigationController

iphone - iOS/Xcode 4 : View won't load

ios - 为什么 collectionView 在滚动时卡住?

ios - 如何在 Swift 中使用 CTRubyAnnotationRef

c++ - 架构 arm64 的 undefined symbol 。对 ObjC++ 文件进行 C 调用?

ios - NavigationBar 为一个 View 设置 TitleColor