开发者

Get the row number of the tableView on single tap in mac app

I have a mac app that uses tableView that has some rows.On taping(single tap ) a particular row, I开发者_JAVA技巧 want that row number.Actually , I want to set the value of the label based on the row number selected.Please help!


Your table delegate can implement - (BOOL)tableView:(NSTableView *)tableView shouldSelectRow:(NSInteger)row;

Seems like that'll give you the row you want, then just return "YES" to allow the selection.

Or your delegate could implement - (void)tableViewSelectionDidChange:(NSNotification *)notification; and then get the currently selected cell (though if you allow multiple selection this might not be sufficient).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜