Assuming that you have NSTextFieldCell in your table (for other cells, setting text color may vary), you can achieve this by implementing a NSTableView's delegate method.
First, you have to define a delegate for the NSTableView, either in Interface Builder or in your code. This can be your application controller for example.
Then, just implement the following method:
- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex {
NSTextFieldCell *cell = aCell;
if (...) {
[cell setTextColor:[NSColor greenColor]];
} else if (...) {
[cell setTextColor:[NSColor redColor]];
} else {
[cell setTextColor:[NSColor blackColor]];
}
}
Each time the NSTableView will draw a cell, you have the opportunity to modify it before it get drawn.
Check out the NSTableViewDelegate documentation page for more details.