我发现6之前版本的iOS版本的NSAttributedString的可用性信息存在冲突。如果向后兼容,它会非常有用。NSAttributedString在iOS 6之前是否可用?
这说,这是可以作为的iOS 4: Why No NSAttributedString on the iPhone?
在苹果网站,它说的iOS 6及更高版本:https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSAttributedString_Class/Reference/Reference.html
我试图实现它在我的代码如下所示:
NSAttributedString *commentString = [[NSAttributedString alloc] initWithString:@"I really love raisins" attributes:@{NSForegroundColorAttributeName: [UIColor blackColor]}];
它适用于iOS 6,但不是当我尝试在iOS 5或iOS 5.1中运行它时。我没有测试过早期版本。
我只是想使用未包含在旧版本中的功能?
这是两天内两次我们在几秒钟内回答了一个ios问题。礼炮。 – Bergasms