Each cell in my UITableView contains a custom UIButton. I can't seem to detect in which cell the currently pressed button lies. Method gets called but indexPath.row is always 0. Any suggestions?
-(IBAction)editButtonTouch:(id)sender {
UITableViewCell *cell = (UITableViewCell *)[sender superview];
NSIndexPath *indexPath = [[self tableView] indexPathForCell:cell];
switch([indexPath row]) {
case 0:
NSLog(@"first row");
break;
case 1:
NSLog(@"second row");
break;
}
}