Crash in iOS 7.0.3 for NSMutableAttributedString [duplicate]

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-21 05:56:16

问题


Since a few days, I have a crash that only happens in iOS with the following line of code

[myAttributedString addAttribute:NSFontAttributeName
                                             value:[UIFont fontWithName:@"HelveticaNeue-Italic" size:myLabel.font.pointSize]
                                             range:rangeOfSubString];

The reason given by debugger is

"Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSConcreteMutableAttributedString addAttribute:value:range:: nil value'" Exception Type: SIGABRT

I know from the documentation that it's the value that's nil. Any idea why [UIFont fontWithName:@"HelveticaNeue-Italic" size:myLabel.font.pointSize] would return nil in iOS 7.0.3? (it was working perfectly well in iOS 7.0.2)


回答1:


That typeface of Helvetica neue seems to be missing

http://www.kateva.org/sh/?p=16961



来源:https://stackoverflow.com/questions/19938436/crash-in-ios-7-0-3-for-nsmutableattributedstring

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!