title: UITableView with multiple items in each cell
body: <p>I have a tableview in which I am trying to place a button with an image and a label. I want to change the image of the button once clicked.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)_tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  
  static NSString *CellIdentifier = @"Cell";
  checkedImg = [UIImage imageNamed:@"buttonUnChecked1.png"];
  
  UITableViewCell *cell = [_tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  if (cell == nil) {
      cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
  }
  
  
  //Set up the cell...
  NSString *cellValue = [suggestions objectAtIndex:indexPath.row];
  
  cell.selectionStyle = UITableViewCellSelectionStyleNone;
  
  check = [UIButton buttonWithType:UIButtonTypeCustom];
  check.frame=CGRectMake(0,35,20,20);
  [check setImage:checkedImg forState:UIControlStateNormal];
  [check addTarget:self action:@selector(checkClicked:) forControlEvents: UIControlEventTouchUpInside];
  [cell.contentView addSubview:check];
  
  cellContent = [[UILabel alloc]initWithFrame:CGRectMake(40,32,500,25)];
  cellContent.text = cellValue;
  [cell.contentView addSubview:cellContent];
  return cell;
  }
  
  
  -(void)checkClicked:(UIButton *)b
  {
  checkedImg = [UIImage imageNamed:@"buttonChecked1.png"];
  [check setImage:checkedImg forState:UIControlStateNormal];
  
  }
  </code></pre>
  
  <p>By doing this, the image of the buttons are getting changed but only the last one and not the one clicked. I know the reason behind it, but I don't know how to achieve what I want.</p>