paddycobbett
asked on
How can I get which row was clicked on a nstableview?
I can't work out how to determine when a row is clicked on a nstableview. A delegate method allows me to determine when a row is selected, but I can't see when a row is clicked. The reason I need to do this is because I need to determine when an already selected row has been clicked again. When developing for the iphone/ipad there is a tableView:didSelectRowAtIn dexPath: however I can't find one for nstableview, which only has - (void)tableViewSelectionDi dChange:(N SNotificat ion *)aNotification, but it doesn't fire if you click an already selected row.
Any ideas?
Any ideas?
You can use the clickedRow in the Tareget-action behavior - see NSTableView Apple Reference
ASKER
Thanks, I did spot that function but thought it was something you called to query the last selected row, I'm guessing the target-action behavior is for setting up a callback? Could you give a couple lines of code to show me how to set that up? Am new to relatively mac programming.
I tryed going along the lines of:
[self.tableView setAction:@selector(clicke dRow)];
[self.tableView setTarget:self];
But then what function is called? Please enlighten me! Thanks very much for your help.
I tryed going along the lines of:
[self.tableView setAction:@selector(clicke
[self.tableView setTarget:self];
But then what function is called? Please enlighten me! Thanks very much for your help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.