title: Table cell reusing button in different section iOS
body: <p>i have created <code>UITableView</code> with 4 section with dynamic numbers of rows, i customized the cell and added button to very cell, buttons are reusing in different section .</p>
  
  <p><strong>My code:</strong></p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  
  
  
   {
  
  
  
       static NSString *CellIdentifier = @"Cell";
       UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  
  
      if (cell == nil)
  
  
       {
  
          cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
  
        }
  
  
       self.buttonMe = [UIButton buttonWithType:UIButtonTypeCustom];
      [ self.buttonMe setFrame:CGRectMake(260.0, 7.0, 30.0, 30.0)];
      self.buttonMe.tag=i;
  
      if([[arrayCheckUnchek objectAtIndex:indexPath.row] isEqualToString:@"Uncheck"])
  
      [ self.buttonMe setImage:[UIImage imageNamed:@"check.gif"] forState:UIControlStateNormal];
  
      else
  
      [ self.buttonMe setImage:[UIImage imageNamed:@"uncheck.jpg"] forState:UIControlStateNormal];
  
      [ self.buttonMe addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
      [cell.contentView addSubview: self.buttonMe];
  
      cell.textLabel.text=@"itsFine";
  //"i", i created for assigning the unique tag for created button every time
      i++;
  
      return cell;
  
  }
  </code></pre>
  
  <p>please give me proper solution with reason of why its happening
  thanks</p>