我有以下代码:
comment = [[NSMutableAttributedString alloc] initWithString:self.highlightItem_.comment];
[comment addAttribute:NSFontAttributeName value:[UIFont fontWithName:kProximaNovaBold size:15] range:nameRange];
[comment addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:128/255.f green:203/255.f blue:255/255.f alpha:1.0] range:nameRange];
[comment addAttribute:NSFontAttributeName value:[UIFont fontWithName:kProximaNova size:15] range:commentRange];
[comment addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithWhite:153/255.f alpha:1.0] range:commentRange];
然而,这是一个 iOS 6 代码,如果我想在 iOS 5 中做同样的事情怎么办。我必须为此使用第三方库吗?