Is there a method to change the background color of a specific column in a cell-based table?
I would like to “highlight” a column after I made a search on the table’s data.
I saw there’s a setHighlightedTableColumn: method for NSTableView class but can’t figure out how to pass the column parameter.
Otherwise, is it possible to use setBackgroundColor on a specific column at runtime?
Yes. You’re right!
The word highlighted in the method name is confusing for me.
Anyway, I found another way to achieve what I want:
I’m moving a 2 pixels high red box above the bottom of the header, setting its left and width according to the column I want to highlight.
I wonder if the option Table View > Selection > Column in Interface Builder can be helpful? It will highlight the entire sort column - but I’m not sure if that’s what you need.
Selecting this option make it possible not only to highlight the Column but also to change its background.
The problem, in my case, is that I don’t want the columns to be selectable.
And finally, I find the red box solution much more elegant.