NSAttributedStringがiPhoneに追加されたと聞きましたが、色を設定するためにキーNSForegroundColorAttributeNameを使用すると、「NSForegroundColorAttributeNameundeclared」というエラーが表示されます。私は何かが足りないのですか?私を助けてください。
よろしく
ヤラッパ
NSAttributedStringがiPhoneに追加されたと聞きましたが、色を設定するためにキーNSForegroundColorAttributeNameを使用すると、「NSForegroundColorAttributeNameundeclared」というエラーが表示されます。私は何かが足りないのですか?私を助けてください。
よろしく
ヤラッパ
BarretJ が kCTForegroundColorAttributeName 定数を使用すると述べたのと同じ問題に遭遇しました。次に例を示します。
NSMutableAttributedString* attrStr = [[NSMutableAttributedString alloc] initWithString:countStr attributes:nil];
[attrStr addAttribute:(NSString*)kCTForegroundColorAttributeName
value:(id)[[UIColor greenColor] CGColor]
range:range];
代わりにkCTForegroundColorAttributeNameを使用してみてください。