本文介绍了添加UIFont并查找fontfamily会与EXC_BAD_ACCESS崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是,当我添加一个字体描述,当我要检索字体系列名称与 [UIFont familyNames] 它崩溃。



这是我的堆栈跟踪:



0x314b9ebe在CFDictionaryGetValue中
0x33d79be4在copy_localized_value中
0x33d79bd4在CGFontNameTableCopyRootName
0x33d796f2在CGFontNameTableCreate
0x33d79e86在CGFontCopyFamilyName
0x3414ca00 AddFontsFromCGFontAndPath
0x3414cb7e in AddFontsFromURLOrPath
0x3414cc98初始化
0x3414ce0a在GSFontCopyFamilyNames
0x323fce84在+ [UIFont familyNames]
...

我在iOS 3.2.2上测试它,因为我不想要我的iPad升级,我不能告诉if它适用于其他iOS版本



我做错了什么?

解决方案

p>您确定字体文件有效并可以正常工作吗?


My problem is, that when I add a font which is described here and when I want to retrieve the font family names with [UIFont familyNames] it crashes. I did it the same way described in the example, but for me it doesn't work.

This is my stack trace:

0x314b9ebe in CFDictionaryGetValue
0x33d79be4 in copy_localized_value
0x33d79bd4 in CGFontNameTableCopyRootName
0x33d796f2 in CGFontNameTableCreate
0x33d79e86 in CGFontCopyFamilyName
0x3414ca00 in AddFontsFromCGFontAndPath
0x3414cb7e in AddFontsFromURLOrPath
0x3414cc98 in Initialize
0x3414ce0a in GSFontCopyFamilyNames
0x323fce84 in +[UIFont familyNames]
...

I'm testing it on iOS 3.2.2 and because i don't want my iPad to be upgraded, I can't tell if it works on other iOS Versions

What am I doing wrong?

解决方案

Are you sure your font file is valid and works?

这篇关于添加UIFont并查找fontfamily会与EXC_BAD_ACCESS崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-09 23:06