title: Getting the Row for Section indexPath in a tableView
body: <p>Recently I put implemented an indexing feature for the user names in my app. I have been trying to access the rows in each section and add them to my recipients array when the user taps the index path. I have tried passing many different values in my objectAtIndex: method but none seem to be working. I am able to log the correct index row and section in indexPathForRow:inSection: method but the return value is an indexPath and not an integer. So something with my objectForIndex: method is obviously not right. Any help or references would be super. cheers!</p>
  
  <p>This line:</p>
  
  <p><code>PFUser *user = [self.friends objectAtIndex:indexPath.section];</code></p>
  
  <p>Returns only the first username in each section, no matter what name I tap in the section. So I need to access the Row in addition, not just the section.</p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  [self.tableView deselectRowAtIndexPath:indexPath animated:NO];
  
  UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
  
  int section = indexPath.section;
  int row = indexPath.row;
  NSIndexPath *newIndexPath = [NSIndexPath indexPathForRow:row inSection:section];
  NSLog(@"newIndexPath: %@", newIndexPath);
  
  PFUser *user = [self.friends objectAtIndex:indexPath.section];
  
  if (cell.accessoryType == UITableViewCellAccessoryNone) {
      cell.accessoryType = UITableViewCellAccessoryCheckmark;
      [self.recipients addObject:user.objectId];
  NSLog(@"added:%@",user);
  }
  else {
      cell.accessoryType = UITableViewCellAccessoryNone;
      [self.recipients removeObject:user.objectId];
      NSLog(@"removed:%@",user);
  }
  
  [self.currentUser saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
      if (error) {
          NSLog(@"Error %@ %@", error, [error userInfo]);
      }
  }];
  }
  </code></pre>