title: UITableViewCell position change while scroll UITableView
body: <p>My <code>UITableViewCell</code> position changed while scroll <code>UITableView</code>. Here i have more <code>UITableViewCell</code>. So it covers more than one page screen. When i scroll top to bottom the position of <code>UITableViewCell</code> is changed such like 1st cell went 5th. And 2nd cell came to 1st and etc.</p>
  
  <p>My Code:</p>
  
  <pre><code>    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:
  (NSIndexPath *)indexPath {
  
      static NSString *CellIdentifier = @"SignUpWithEmailCell";
  
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  
  if (cell == nil)
  {
      cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
      cell.backgroundColor = [UIColor clearColor];
      cell.selectionStyle = UITableViewCellSelectionStyleNone;
  
      switch (indexPath.row) {
  
          case 0: {
  
              UILabel *lblFirstName = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 40)];
              lblFirstName.text = @"First Name";
              [cell.contentView addSubview:lblFirstName];
  
              self.txtFirstName = [[UITextField alloc]initWithFrame:CGRectMake(lblFirstName.frame.origin.x + lblFirstName.frame.size.width + 5, 0, 190, 40)];
              self.txtFirstName.delegate = self;
              self.txtFirstName.text = strFirstName;
              self.txtFirstName.tag = 0;
              self.txtFirstName.userInteractionEnabled = YES;
              self.txtFirstName.font = [UIFont systemFontOfSize:15.0];
              self.txtFirstName.clearButtonMode = UITextFieldViewModeWhileEditing;
              self.txtFirstName.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
              [cell.contentView addSubview:self.txtFirstName];
              break;
          } case 1: {
  
              UILabel *lblLastName = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 40)];
              lblLastName.text = @"Last Name";
              [cell.contentView addSubview:lblLastName];
  
              self.txtLastName = [[UITextField alloc]initWithFrame:CGRectMake(lblLastName.frame.origin.x + lblLastName.frame.size.width + 5, 0, 190, 40)];
              self.txtLastName.backgroundColor = [UIColor clearColor];
              self.txtLastName.delegate = self;
              self.txtLastName.tag = 1;
              self.txtLastName.text = strLastName;
              self.txtFirstName.userInteractionEnabled = YES;
              self.txtLastName.returnKeyType = UIReturnKeyDone;
              self.txtLastName.clearButtonMode = UITextFieldViewModeWhileEditing;
              self.txtLastName.font = [UIFont systemFontOfSize:15.0];
              self.txtLastName.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
              [cell.contentView addSubview:self.txtLastName];
              break;
          }
          default:
              break;
      }
  }
  
   return cell;
  }
  </code></pre>
  
  <p>Could anyone guide me to archive it correctly..</p>
  
  <p>Thanks in Advance.</p>