Replace setBackgroundStyle: in NSTableCellView to know when the background changes, which affects the color of the text that you should use in your cell.
For instance:
- (void)setBackgroundStyle:(NSBackgroundStyle)style { [super setBackgroundStyle:style]; // If the cell text color is black, this sets it to white [((NSCell *)self.descriptionField.cell) setBackgroundStyle:style]; // Otherwise you need to change the color manually switch (style) { case NSBackgroundStyleLight: [self.descriptionField setTextColor:[NSColor colorWithCalibratedWhite:0.4 alpha:1.0]]; break; case NSBackgroundStyleDark: default: [self.descriptionField setTextColor:[NSColor colorWithCalibratedWhite:1.0 alpha:1.0]]; break; } }
In the source table of the list, the style style of the background image of the cell is set to “Light”, as well as to its text element backgroundStyle, however textField also draws a shadow under its text and has not yet found exactly what controls this / definition, which should happen.
source share