title: How to let user to modify the text in UITableView cells
body: <p>I have a question regarding uitable view.</p>
  
  <p>I am implementing an app which is similar to the address book app.I am able to present the     table view in editing mode. I want to let the user to edit the text in the cells in editing  mode. I know that in order to edit the text in the cells, I need a textfield. I have created a textfield.</p>
  
  <p>My question is:</p>
  
  <ol>
  <li><p>what should I do in order to present that textfield in the cells.</p></li>
  <li><p>what are the methods I need to implement in order to present that text field in the table view in editing mode.</p></li>
  <li><p>Once I am done with editing ,How can I update the data which is in my contacts view controller(contains all the contacts).The saving should persist in the address book. For this question I know that I need to implement some delegate method,But I am not sure how to do that.</p></li>
  </ol>
  
  <p>Please have a look at the following code,so that you will have an idea about my problem.</p>
  
  <pre><code> - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath
  {
  [tableView setSeparatorColor:[UIColor clearColor]];
  //[self.tableView setEditing: YES  animated: YES];
  
  
  static NSString *CellIdentifier = @"Cell";
  
  UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
  if (cell == nil) {
      cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
  }
  
  // Configure the cell...
  if(isEditingOn) {
  
  if(cell == nil)
          cell = [self getCellContentView:CellIdentifier];
       UILabel *lblTemp1 = (UILabel *)[cell viewWithTag:1];
       UITextField *textfield1=(UITextField*)[cell viewWithTag:2];
  
  if(indexPath.row == 0) {
          lblTemp1.text = @"Name";
          textfield1.text = myContact.name;
      }
  
  else if(indexPath.row == 1) {
          lblTemp1.text = @"Phone";
          textfield1.text = myContact.phone;
      }
  
  else if(indexPath.row == 2) {
          lblTemp1.text = @"Email";
          textfield1.text = myContact.email;
  }
  
  }
  
  else {    
  
  if(indexPath.row == 0) {
      cell.textLabel.text = myContact.name;
  }
  
  else if(indexPath.row == 1) {
      cell.textLabel.text = myContact.phone;
  }
  
  else if(indexPath.row == 2) {
      cell.textLabel.text = myContact.email;
  }
  }
  
  
  return cell;
  </code></pre>
  
  <p>}</p>
  
  <pre><code>- (UITableViewCell *) getCellContentView:(NSString *)cellIdentifier {
  
  CGRect CellFrame = CGRectMake(0, 0, 60, 20);
  CGRect Label1Frame = CGRectMake(10, 10, 180, 25);
  UILabel *lblTemp;
  UITableViewCell *cell = [[[UITableViewCell alloc] initWithFrame:CellFrame  reuseIdentifier:cellIdentifier] autorelease];
  lblTemp = [[UILabel alloc] initWithFrame:Label1Frame];
  lblTemp.tag = 1;
  [cell.contentView addSubview:lblTemp];
  [lblTemp release];
  CGRect TextFieldFrame=CGRectMake(240, 10, 60, 25);
  UITextField *textfield;
  textfield=[[UITextField alloc]initWithFrame:TextFieldFrame];
  textfield.tag=2;
  textfield.placeholder = @"";
  [cell.contentView addSubview:textfield];
  
  }
  </code></pre>