views:

286

answers:

3

Hi, I am developing an application in cocoa which needs to select an item by clicking a check box inside a NSTableview.I need to select the cell without highlighting the row of table view Is it possible to do this... Thanks in advance

+1  A: 

NSTableView has a method called setSelectionHighlightStyle: to which you can send NSTableViewSelectionHighlightStyleNone as an option and it will not show a highlight.

So, in awakeFromNib: or similar:

[tableView setSelectionHighlightStyle:NSTableViewSelectionHighlightStyleNone];

ctshryock
A: 

Normally, only selectable or selected cells can be tracked; checkboxes need tracking in order to be checked/unchecked.

But it may be possible to do what you want by using the NSTableView's delegate: the tableView:shouldTrackCell:forTableColumn:row: method can be used to allow the tracking of non-selectable or non-selected cells.

Laurent Etiemble
A: 

Why not set the relevant Boolean property in the underlying model? If you're using Bindings, the table view should pick up the change automatically; if not, you can tell the table view to reload that row.

Peter Hosey