I have this line "func tableView(_ tableView: NSTableView, didClick tableColumn: NSTableColumn) {code here}"
This function does not do anything. I want to click a row in a table view and do some action when clicked it. But it does not do anything. The row is showed correctly, but action is missing. I added also "print("Clicked") in that function, but even that does not show on log information"
How else could I make this working?
From the documentation of
tableView(_:didClick:)
: "Tells the delegate that the mouse button was clicked in the specified table column, but the column was not dragged.". This method isn't called when you click in a row. If you want to catch clicks in a tableview, subclass the table view, row view or cell view and overridemouseDown(with:)
. Another solution: let the table view handle the click and use the selected row. The delegate has several methods to detect changes in the selection.