我无法使用模拟器 5.0 在 xcod4.2 中编写以下代码告诉我替代解决方案
NSMutableAttributedString *str=[[NSMutableAttributedString alloc] initwithString:@"This is Green and Red"];
NSDictionary *redatt=@{NSForeGroundColorAttributeName:[UIColor redColor]};
NSDictionary *greenatt=@{NSForeGroundColorAttributeName:[UIColor greenColor]};
[str setAttribute:greenatt range:NSMakeRange(9,5)];
[str setAttribute:redatt range:NSMakeRange(19,3)];
lbl.attributedText=str;