单击按钮时如何在基于 View 的表格中获取按钮的行?单击按钮时未选择该行,但我发现如果您在按钮的操作方法中记录 sender.superview.superview,我会得到:NSTableRowView: 0x1001b3a90 - row: 2。所以,该行在日志中,但我不知道如何以编程方式实现它。我在 NSTableCellView 的子类中有按钮的操作方法。
最佳答案
-[NSTableView rowForView:]
在其文档中这样说:
This is typically needed in the action method for an NSButton (or NSControl) to find out what row (and column) the action should be performed on.
关于objective-c - 在基于 View 的表中获取按钮的行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10202813/