Кто может мне помочь? Я хочу, чтобы строка была красной, но всегда всегда красная строка.Как установить цвет одной строки в NSTableView?
-(void)tableView:(NSTableView *)tableView willDisplayCell:(id)cell
forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
{
NSColor *cRed = [NSColor redColor];
NSTextFieldCell* cCell = (NSTextFieldCell*)cell;
if ([[tableView selectedRowIndexes] containsIndex:4])
{
[cCell setTextColor:cRed];
}
else
{
[cCell setTextColor:[NSColor blackColor]];
}
}
Половина успеха Но я хочу, чтобы строка была красной, а не setTextColor, является setBackgroundColor [cCell setBackgroundColor: cRed]; Почему строка не должна быть красной? – Taylee