title: UITableView - Change text field that's on the same row as the button being pressed
body: <p>I've been experimenting with table views for the first time, and am confused as to how UI elements such as text fields are differentiated between when taking action on cells (e.g. pressing a button).</p>
  
  <p>Right now I have a button and a text field on each row. To make this:</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
  static NSString *CellIdentifier = @"gameCell";
      gameViewCell *cell = [tableView
                          dequeueReusableCellWithIdentifier:CellIdentifier
                          forIndexPath:indexPath];
  
      long row = [indexPath row];
  
  //Button to change text field
      strokeUp = [UIButton buttonWithType:UIButtonTypeCustom];
      strokeUp.frame = CGRectMake(248.0f, 11.0f, 80.0f, 32.0f);
      [strokeUp setTag:indexPath.row];
      [strokeUp addTarget:self action:@selector(addStroke:) forControlEvents:UIControlEventTouchUpInside];
      [cell.contentView addSubview:strokeUp];
  
  //Text field that changes (puts '1' in box for now)
      strokesBox = [[UITextField alloc] initWithFrame:CGRectMake(223.0f, 11.0f, 37.0f, 32.0f)];
      strokesBox.delegate = self;
      [strokesBox setTag:indexPath.row];
      [cell.contentView addSubview:strokesBox];
  
      return cell;
  }
  </code></pre>
  
  <p>And this is what I'm doing when the strokeUp button is tapped. I want the text field that's on the same row as the button to display '1' (later it'll add 1 to what's currently in the box). The number of rows varies from 2 to 6 depending on how many rows the user chose in the previous screen.</p>
  
  <pre><code>- (void)addStroke:(id)sender
  {
      CGPoint buttonPosition = [sender convertPoint:CGPointZero toView:table];
      NSIndexPath *indexPath = [table indexPathForRowAtPoint:buttonPosition];
      UIButton *senderButton = (UIButton *)sender;
      if (senderButton.tag == 0)
      {
          NSLog(@"Row 1");
          UITableViewCell *cell = [table cellForRowAtIndexPath:indexPath];
          UITextField *sampleField = (UITextField *)[cell viewWithTag:0];
          theTextField = @"1";
      }
      else if (senderButton.tag == 1) {
          NSLog(@"Row 2");
          UITableViewCell *cell = [table cellForRowAtIndexPath:indexPath];
          UITextField *sampleField = (UITextField *)[cell viewWithTag:1];
          sampleField.text = @"1";
      }
  }
  </code></pre>