Every ‘btn1’ call the same method.

PS: This is an UITableView
I want to know how to get from which row the button was pressed. I tried to do a loop in every button an set the buttons tag differently from the last one:
// Handle the buttons tag
int tagCount = 100;
// mainArray is the array of the tableView
for (int i = 0; i < [self.mainArray count]; i++) {
// I created a NSIndexPath to access the tableView cells
NSIndexPath *nowIndex = [NSIndexPath indexPathForRow:i inSection:0];
UITableViewCell *cell = (UITableViewCell *)[(UITableView *)self.view cellForRowAtIndexPath:nowIndex];
// I set the button tag as the 'int';
UIButton *shareButton = (UIButton *)[cell viewWithTag:100];
[shareButton setTag:tagCount];
tagCount++;
}
But the tag’s still equal to 100;
Any solution?
If the buttons are
UIButtoninstances then set the tag property (maybe to the row number). In the event method you can test the tag property to see which button was pressed.