NSTableView - Disable Row Selection

后端 未结 8 1483
温柔的废话
温柔的废话 2021-01-01 15:25

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

相关标签:
8条回答
  • 2021-01-01 15:50

    Swift 4.0

    func tableView(_ tableView: NSTableView, shouldSelectRow row: Int) -> Bool {
        return false
    }
    
    0 讨论(0)
  • 2021-01-01 15:50

    Using Binding:

    Another approach is select 'empty' in the list of checkboxes corresponding to 'Selection' in Attribute Inspector of table view. This will not select any rows by default.

    In addition to this, make the highlight option to 'None'.

    screenshot of attribute inspector

    0 讨论(0)
提交回复
热议问题