I am struggling with this, I cannot help but feel that I am missing something obvious!
I have an NSTable that contains a table cell view, which in turn contains an NSButton.
The button has an installed outlet, and the output is displayed in the table view.
I use the following code to get the index of the row the button is in when the user clicks on this button:
- (IBAction)approveButtonInTable:(id)sender { NSInteger selected = [self.tweetTableView clickedRow]; NSLog(@"sender sends :%ld", selected); }
However, this always answered with -1, which is not very useful.
Did I miss something very obvious here?
thanks
Gareth
Change 1
I found out that this works if I use it on the output from tableview using this:
- (IBAction)tweetTableAction:(id)sender { NSInteger selected = [_tweetTableView clickedRow]; NSLog(@"sender sends :%ld", selected); }
However, this does not help me, since I still cannot get it to work when I press the button, doh!
source share