NSAutlineViewにNSAttributedStringを使用してフォーマットしたデータを入力しています。これまでのところ、私はテキストフォント、サイズ、色をフォーマットしました。私の問題は、行が選択されても前景色が変わらないことです。 NSTextFieldCellを作成し、インターフェイスビルダのdisabledControlTextColorに色を設定した場合、正常に動作します。選択されていない場合は灰色で表示され、白で選択すると、プログラムでこの色を属性付き文字列定義に設定すると、グレー。NSCellのNSAttributedString
NSMutableAttributedString *result = [[[NSMutableAttributedString alloc] initWithString:value] autorelease];
NSDictionary *attributes = [[NSDictionary dictionaryWithObjectsAndKeys:
[NSFont systemFontOfSize:[NSFont systemFontSize] -1], NSFontAttributeName,
[NSColor disabledControlTextColor], NSForegroundColorAttributeName, nil] retain];
[result addAttributes:attributes range:[value rangeOfString:value]];
ありがとうございます。