NSAttributedStringを使用してフォーマットしたデータをNSOutlineViewに入力しています。これまで、テキストのフォント、サイズ、色をフォーマットしました。私の問題は、行を選択しても前景色が変わらないことです。NSTextFieldCellを作成し、Interface Builderで色をdisabledControlTextColorに設定すると、正常に機能します。選択されていない場合は灰色で表示され、白で選択されている場合は、プログラムでこの色を属性付き文字列定義に設定すると、常に次のように表示されます。グレー。
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]];
前もって感謝します。