title: how updation of title works if we are not doing through code?
body: <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] autorelease];
      }
  
     int flag = appdelegate.flag;
  
      if (flag) {
  
          if (![cell.contentView viewWithTag:1122377]) {
  
              UIButton *btnEdit = [UIButton buttonWithType:UIButtonTypeCustom];
  
              if (appDelegate.deviceTypeIpad) {
                  btnEdit.frame = CGRectMake(tableView.frame.size.width - 150, 10, 26, 24);
              }
              else {
                  btnEdit.frame = CGRectMake(tableView.frame.size.width - 120, 10, 26, 24);
  
              }
              btnEdit.tag = 1122377;
              NSString *title = [NSString stringWithFormat:@"%d",indexPath.row];
              [btnEdit setTitle:title forState:UIControlStateNormal];
              [btnEdit setImage:[UIImage imageNamed:@"edit_ma.png"] forState:UIControlStateNormal];
              [btnEdit addTarget:self action:@selector(editConfiguration:) forControlEvents:UIControlEventTouchUpInside];
             // btnEdit.tag = indexPath.row;
  
              [cell.contentView addSubview:btnEdit];
          }
          UIButton *tempBtn = (UIButton *)[cell.contentView viewWithTag:1122377];
          NSLog(@"%@ titleString ", tempBtn.titleLabel);
          UIButton *imgView = (UIButton *)[cell.contentView viewWithTag:112238];
  
          if (!imgView) {
  
              if (![cell.contentView viewWithTag:112238]) {
                  UIButton *btnDelete = [UIButton buttonWithType:UIButtonTypeCustom];
                  if (appDelegate.deviceTypeIpad) {
                      btnDelete.frame = CGRectMake(tableView.frame.size.width - 100, 10, 26, 24);
                  }
                  else {
                      btnDelete.frame = CGRectMake(tableView.frame.size.width - 75, 10, 26, 24);
                  }
                  btnDelete.tag = 112238;
                  NSString *title = [NSString stringWithFormat:@"%d",indexPath.row];
                  [btnDelete setTitle:title forState:UIControlStateNormal];
                  [btnDelete setImage:[UIImage imageNamed:@"trash_ma.png"] forState:UIControlStateNormal];
                  [btnDelete addTarget:self action:@selector(deleteConfiguration:) forControlEvents:UIControlEventTouchUpInside];
                  // btnDelete.tag = indexPath.row;
  
                  [cell.contentView addSubview:btnDelete];
  
              }
          }
          NSLog(@"%@ titleString",imgView.titleLabel);
      }
      else {
  
          [[cell.contentView viewWithTag:1122377] removeFromSuperview];
          [[cell.contentView viewWithTag:112238] removeFromSuperview];
  
      }
  }
  
  
  -(void)deleteConfiguration:(id)sender
  {
  
      updateIndex =  [[[(UIButton *)sender titleLabel] text] integerValue];
  
  }
  </code></pre>
  
  <p>If the Edit or Delete button already exists in the cell then I am doing nothing in this method.</p>
  
  <p>Still If I am deleting any cell then how come on deleting next cell I am getting the correct updateIndex, since indexing in <code>UITableView</code> will be changed right on deleting a single cell even. Please give answer could not find out the reason..</p>
  
  <p>Also please Let me know if its the correct way to add buttons on cell Or Always if we need to add buttons to cell we should customize cell and then add, even if we need to add a single button.</p>
  
  <p>Thanks a lot in advance  </p>
  
  <p><strong>Edit 1:</strong> Logically the solution is:</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] autorelease];
      }
  
      int flag = appdelegate.flag;
  
  
  //   [[cell.contentView viewWithTag:1122377] removeFromSuperview];
  //   [[cell.contentView viewWithTag:112238] removeFromSuperview];
  
      if (flag) {
  
          if (![cell.contentView viewWithTag:1122377]) {
  
              UIButton *btnEdit = [UIButton buttonWithType:UIButtonTypeCustom];
  
              if (appDelegate.deviceTypeIpad) {
                  btnEdit.frame = CGRectMake(tableView.frame.size.width - 150, 10, 26, 24);
              }
              else {
                  btnEdit.frame = CGRectMake(tableView.frame.size.width - 120, 10, 26, 24);
  
              }
              btnEdit.tag = 1122377;
              NSString *title = [NSString stringWithFormat:@"%d",indexPath.row];
              [btnEdit setTitle:title forState:UIControlStateNormal];
              [btnEdit setImage:[UIImage imageNamed:@"edit_ma.png"] forState:UIControlStateNormal];
              [btnEdit addTarget:self action:@selector(editConfiguration:) forControlEvents:UIControlEventTouchUpInside];
              // btnEdit.tag = indexPath.row;
  
              [cell.contentView addSubview:btnEdit];
          }
          else {
              UIButton *btn = (UIButton *)[cell.contentView viewWithTag:1122377];
              NSString *title = [NSString stringWithFormat:@"%d",indexPath.row];
              [btn setTitle:title forState:UIControlStateNormal];
          }
  
  
          if (![cell.contentView viewWithTag:112238]) {
              UIButton *btnDelete = [UIButton buttonWithType:UIButtonTypeCustom];
              if (appDelegate.deviceTypeIpad) {
                  btnDelete.frame = CGRectMake(tableView.frame.size.width - 100, 10, 26, 24);
              }
              else {
                  btnDelete.frame = CGRectMake(tableView.frame.size.width - 75, 10, 26, 24);
              }
              btnDelete.tag = 112238;
              NSString *title = [NSString stringWithFormat:@"%d",indexPath.row];
              [btnDelete setTitle:title forState:UIControlStateNormal];
              [btnDelete setImage:[UIImage imageNamed:@"trash_ma.png"] forState:UIControlStateNormal];
              [btnDelete addTarget:self action:@selector(deleteConfiguration:) forControlEvents:UIControlEventTouchUpInside];
              // btnDelete.tag = indexPath.row;
  
              [cell.contentView addSubview:btnDelete];
  
          }
          else {
              UIButton *btn = (UIButton *)[cell.contentView viewWithTag:112238];
              NSString *title = [NSString stringWithFormat:@"%d",indexPath.row];
              [btn setTitle:title forState:UIControlStateNormal];
          }
  
      }
      else {
  
          [[cell.contentView viewWithTag:1122377] removeFromSuperview];
          [[cell.contentView viewWithTag:112238] removeFromSuperview];
  
      }
  
  
      return cell;
  }
  </code></pre>
  
  <p>I can fix my previous code(where m nt updating title of button) once I obtain bug in it, but I am unable to reproduce the bug. Although the previous code is incorrect how is it working then is the real question..Please take out time and tell the hidden thing behind it..Thanks a Lot in advance..Pl Let me know if i shud provide any other details.</p>