是否有等效的
方法tableView:indexPathForCell
在Mac上?
我正在尝试按下按钮的行。
答案 0 :(得分:2)
尝试使用连接到按钮的此方法。代码需要在类视图的委托中。
-(IBAction)buttonClick:(NSButton *)sender {
NSInteger buttonRow = [self.tv rowForView:sender]; //tv is IBOutlet for the tableView
NSLog(@"%ld",buttonRow);
}