title: iOS Xcode - Grouped TableView separator line display
body: <p>Am I the only one who get this problem? </p>
  
  <p>I have few sections and few rows in grouped table view, for registration page. When I slide up and down the page, there's strange separator bold line appear between two cells. Some of the cell sinks like it has been pressed. Is this a iOS 5.0 bug? I have worked for 3 days for this little problem. Please help!</p>
  
  <p>I have try </p>
  
  <p><code>self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
  </code></p>
  
  <p>and </p>
  
  <pre><code>self.tableView.separatorColor = [UIColor lightGrayColor];
  </code></pre>
  
  <p>None of them work.</p>
  
  <p>[Edited]</p>
  
  <p>Paul Peelen you're right and I know what you meant, but I don't have the knowledge to continue forward. Before I comment the "if(cell == nil)", everything is the same as what you've said. But after I comment it, the label is displayed well and no problem with the separator line anymore, but when I insert the texts into the textField and slide down, and up again, the textField's text is gone and been refreshed. How do I solve this one?
  Below is my code:</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ 
  static NSString *CellIdentifier = @"LabelCell";
  UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  
  //Here's the problem!
  if(cell == nil)
      cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
  
  cell.selectionStyle = UITableViewCellSelectionStyleNone;
  
  UILabel *keyLbl = [[UILabel alloc] initWithFrame:CGRectMake(15, 8, 100, 30)];
  keyLbl.font = [UIFont fontWithName:@"Futura-CondensedExtraBold" size:15.0];
  keyLbl.textColor = [UIColor colorWithRed:0.275 green:0.275 blue:0.275 alpha:0.9];
  keyLbl.backgroundColor = [UIColor clearColor];
  
  
  valTxtField = [[UITextField alloc] initWithFrame:CGRectMake(120, 5, 180, 30)];
  valTxtField.font = [UIFont fontWithName:@"Futura-CondensedExtraBold" size:18.0];
  valTxtField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
  valTxtField.delegate = self;
  valTxtField.returnKeyType = UIReturnKeyDone;
  valTxtField.autocorrectionType = UITextAutocorrectionTypeNo;
  valTxtField.autocapitalizationType = UITextAutocapitalizationTypeNone;
  
  if(indexPath.section == 0)
  {
      if(indexPath.row == 0)
      {
          keyLbl.text = NSLocalizedString(@"REGIS_EMAIL", nil);
          email_TextField = valTxtField;
      }
      else if(indexPath.row == 1)
      {
          keyLbl.text = NSLocalizedString(@"REGIS_RE_EMAIL", nil);
          reEmail_TextField = valTxtField;  
      }
      else if(indexPath.row == 2)
      {
          keyLbl.text = NSLocalizedString(@"REGIS_PWD", nil);
          password_TextField = valTxtField;
          valTxtField.secureTextEntry = YES;
      } 
      else if(indexPath.row == 3)
      {
          keyLbl.text = NSLocalizedString(@"REGIS_RE_PWD", nil);
          rePassword_TextField = valTxtField;
          valTxtField.secureTextEntry = YES;
      }
  
  }
  else if(indexPath.section == 1)
  {
      if(indexPath.row == 0)
      {
          keyLbl.text = NSLocalizedString(@"REGIS_FIRSTNAME", nil);
          firstName_TextField = valTxtField;
      }
      if(indexPath.row == 1)
      {
          keyLbl.text = NSLocalizedString(@"REGIS_LASTNAME", nil);
          lastName_TextField = valTxtField;
      }
      if(indexPath.row == 2)
      {
          keyLbl.text = NSLocalizedString(@"REGIS_POSTCODE", nil);
          postCode_TextField = valTxtField;
      }
      if(indexPath.row == 3)
      {
          keyLbl.text = NSLocalizedString(@"REGIS_GENDER", nil);
          gender_TextField = valTxtField;
      }
      if(indexPath.row == 4)
      {
          keyLbl.text = NSLocalizedString(@"REGIS_DOB", nil);
          DOB_TextField = valTxtField;
      }
      if(indexPath.row == 5)
      {
          keyLbl.text = NSLocalizedString(@"REGIS_MOBILE", nil);
          mobile_TextField = valTxtField;
      }
  }
  [cell addSubview:keyLbl];
  [cell addSubview:valTxtField];
  [keyLbl release];
  [valTxtField release];
  
  return cell;
  </code></pre>
  
  <p>}</p>