Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Monaj

macrumors regular
Original poster
May 24, 2009
193
0
Hi all,

In my application I have taken a table view and displaying some NSString objects within it. User can also edit any row within it.

When I do not change color of NSTextFieldCell in NSTableColumn in IB, it shows default display property of table view ie. when a row is selected, text of selected row starts appearing white, but when I change it to some other color, say blue, then it starts appearing like this:

EoXuCor


To resolve this problem I tried to set text color of cell in selected row as white in table delegate method: tableView:willDisplayCell:forTableColumn:row:, but it caused another problem- text remained white when edited, thus it became difficult for user to identify text entered:

Tnzb18x


Can anyone suggest me some suitable solution to resolve it?

Thanks,

Monaj
 
You probably need to write a custom NSTextFieldCell that draws the text directly based on whether it has a selection or not.

See -[NSCell drawWithFrame:inView:]
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.