问题
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?
回答1:
Are you sure your font file is valid and works?
来源:https://stackoverflow.com/questions/8727710/adding-a-uifont-and-looking-for-the-fontfamily-crashes-with-exc-bad-access