NSTableView text color

Is there a way to change the color of the text in a cell in a tableview? I can’t find any info on this in the docs. Only setBackgroundColor which doesn’t really help.

My app allows you to toggle an item on or off, green text if on, red text if off. I would just use an image cell and swap images but every time I place the cell in the column in IB and build and run, I get a SIGABRT so I figured I’d go back to the text color and ask around.

Thanks

You can bind the text color to an NSColor.

Hmm…I don’t guess I understand how to do that. How do I bind text colors?

You need a column in your data that holds an NSColor. Then you just bind the table column’s Font Color to it in the Bindings panel.

Hi
I have exactly the same problem. So if i understood well all topics i found. I have to :
declare : property parent : class “NSColor”
In the list which will populate my table view, i must had a property color and bind it to the array controller.

But i didn’t arrive to do that.

For the moment, i use Shane method

 
set tempList to {}
        repeat with i from 1 to count of theNames
            set end of tempList to {theName:item i of theNames, theSize:item i of theSizes, isVisible:item i of isVisibles, chemin: item i of chemins}
        end repeat

Thanks