title: UITableViewCell Custom accessory - get the row of accessory
body: <p>I have a pretty big issue. I am trying to create a favorite-button on every <code>UITableViewCell</code> in a <code>UITableView</code>. That works very good, and I currently have an action and selector performed when pressed.</p>
  
  <pre><code>accessory = [UIButton buttonWithType:UIButtonTypeCustom];
  [accessory setImage:[UIImage imageNamed:@"star.png"] forState:UIControlStateNormal];
  accessory.frame = CGRectMake(0, 0, 15, 15);
  accessory.userInteractionEnabled = YES;
  [accessory addTarget:self action:@selector(didTapStar) forControlEvents:UIControlEventTouchUpInside];
  cell.accessoryView = accessory;
  </code></pre>
  
  <p>And selector:</p>
  
  <pre><code>- (void) didTapStar {
      UITableViewCell *newCell = [tableView cellForRowAtIndexPath:/* indexPath? */];
  
      accessory = [UIButton buttonWithType:UIButtonTypeCustom];
      [accessory setImage:[UIImage imageNamed:@"stared.png"] forState:UIControlStateNormal];
      accessory.frame = CGRectMake(0, 0, 26, 26);
      accessory.userInteractionEnabled = YES;
      [accessory addTarget:self action:@selector(didTapStar) forControlEvents:UIControlEventTouchDown];
      newCell.accessoryView = accessory;
  }
  </code></pre>
  
  <p>Now, here's the problem: I want to know what row the accessory that was pressed belongs to.
  How can I do this?</p>
  
  <p>Thank you :)</p>