i am having a custom tableview cell where i have a UIButton. i want to write action for every button placed in tableview cell. tell me how to do it. i have tried using tag but its not working as cellForRowAtIndexPath load all the cell at once so its overwriting the tag number. please tell me how to do it. following code i am using
if(indexPath.row == 0){[cell.viewButton addTarget:self action:@selector(playMovie) forControlEvents:UIControlEventTouchUpInside];
cell.viewButton.tag = 1;
}
else {
[cell.viewButton addTarget:self action:@selector(playMovie) forControlEvents:UIControlEventTouchUpInside];
cell.viewButton.tag = 2;
}
return cell;