AliSoftware / AliSoftware/OHAttributedLabel

NSMutableAttributedString setFont functions crash with iOS 6 drawing functions

未关闭
#89 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Apple Bug
主要语言
Objective-C
星标
1.5k
派生
341
PR 合并指标
30 天内没有已合并 PR

描述

Just a heads-up.

NSAttributedStrings with the font attribute set using the old Core Text functions (which the methods in the NSAttributedString attributes category included with this project use), when drawn using the new iOS 6 NSAttributedString drawing functions, will crash.

```
NSMutableAttributedString* foo = [NSMutableAttributedString attributedStringWithString:@"foo"];
[foo setFontName:@"Helvetica" size:13];
[foo boundingRectWithSize:CGSizeMake(320, 50) options:0 context:nil]; // CRASH
```

It appears that Apple assumed that the attribute value would be a UIFont object, when the documentation for the Core Text font attribute (still) says that it needs to be a CTFont object.

Although this is an iOS bug and not you guys' fault, you should probably still keep this in mind.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。