Search code examples
cocoaselectionnstableview

NSTableView - Disable Row Selection


I have a NSTableView and I want to disable row selection.

The columns of the table view are bound to a NSArrayController and the content of the array does show up in the table view.

How can I do this just using bindings?


Solution

  • I think you'll need to use a TableViewDelegate and implement

    - (NSIndexSet *)tableView:(NSTableView *)tableView 
        selectionIndexesForProposedSelection:(NSIndexSet *)proposedSelectionIndexes