AliSoftware / AliSoftware/OHAttributedLabel

NSMutableAttributedString setFont functions crash with iOS 6 drawing functions

Ouverte
#89 6 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Apple Bug
Langage dominant
Objective-C
Étoiles
1.5k
Forks
341
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.