title: Recognize the row that the button was pressed
body: <p>Every 'btn1' call the same method.</p>
  
  <p><img src="https://i.stack.imgur.com/wHcMW.png" alt="Example"><br>
  PS: This is an <code>UITableView</code></p>
  
  <p>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:</p>
  
  <pre><code>// Handle the buttons tag
  int tagCount = 100;
  
  // mainArray is the array of the tableView
  for (int i = 0; i &lt; [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++;
  }
  </code></pre>
  
  <p>But the tag's still equal to 100;</p>
  
  <p>Any solution?</p>