NSTableView: detecting a mouse click together with the row and column

后端 未结 6 535
Happy的楠姐
Happy的楠姐 2020-12-08 01:10

I\'m trying to detect when a mouse click occurs in an NSTableView, and when it does, to determine the row and column of the cell that was clicked.

So far I\'ve tried

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-08 01:44

    I would prefer doing as follows.

    Override

    -(BOOL)tableView:(NSTableView *)tableView shouldSelectRow:(NSInteger)row;
    

    Provide super implementation;

    RequiredRow = row;
    RequiredColumn = [tableView clickedColumn];
    

    Hope this helps.

提交回复
热议问题