I\'m adding a button to a UITableViewCell programmatically. The method to be run when the button is pressed is - (void) quantityDown:(id)sender rowNumber:(int)rowNum<
Set each button tag as indexPath.row
. Then just declare the function:
- (void)quantityDown:(id)sender
In that method do this:
UIButton *btn = (UIButton *)sender;
Add target like this:
[buttonDown addTarget:self action:@selector(quantityDown:) forControlEvents:UIControlEventTouchUpInside];
From btn.tag
you can get the row number. Hope this helps. :)