title: How to use tableView:editingStyleForRowAtIndexPath?
body: <p>I have a very simple application with a UITableViewController. Upon EDITING, I am trying to slide a row into position 0 of the first section. The new row should have an INSERT editing style while the existing row should have a DELETE style.</p>
  
  <p>I've overridden the following 4 methods:</p>
  
  <pre><code>
  // Customize the number of rows in the table view.
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
       if (self.editing && section == 0) {
   return2;
       }
      return 1;
  }
  
  - (UITableViewCellEditingStyle)tableView:(UITableView*)tableView
               editingStyleForRowAtIndexPath:(NSIndexPath*)indexPath {
       int section = indexPath.section;
       int row = indexPath.row;
       if (self.editing && section == 0 && row == 0) {
  return UITableViewCellEditingStyleInsert;
       }
  return UITableViewCellEditingStyleDelete;
  }
  
  - (void)setEditing:(BOOL)editing animated:(BOOL)animated {
       [super setEditing:editing animated:animated];
  NSIndexPath *ip = [NSIndexPath indexPathForRow:0 inSection:0];
       [self.tableView beginUpdates];
       if (editing) {
            [self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:ip]
   withRowAnimation:UITableViewRowAnimationLeft];
       } else {
            [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:ip]
   withRowAnimation:UITableViewRowAnimationFade];          
       }
       [self.tableView endUpdates];
  }
  
  // Customize the appearance of table view cells.
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
      static NSString *CellIdentifier = @"ClientsControllerCell";
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
      if (cell == nil) {
          cell = [[[UITableViewCell alloc ] initWithStyle:UITableViewCellStyleValue1reuseIdentifier:CellIdentifier] autorelease];
      }
      int section = indexPath.section;
      int row = indexPath.row;
      if (self.editing && section == 0 && row == 0) {
            cell.textLabel.text = @"Add Me";
            cell.detailTextLabel.text = @"Detail text";          
       } else {
            cell.textLabel.text = @"Test me";
            cell.detailTextLabel.text = @"Detail text";          
       }
      return cell;
  }
  </code></pre>
  
  <p>But as soon as I go into EDIT mode, "both" cells end up with an editing style of UITableViewCellEditingStyleInsert.</p>
  
  <p>If I change my logic and append the new cell to the END - then it correctly draws the cells with a DELETE style and the new cell get's an INSERT.</p>
  
  <p>Either way, tableView:editingStyleForRowAtIndexPath gets invoked 4 times. In fact, if I insert the new cell into section:0 row:0, this method gets called with section:row 0:0, 0:1, 0:0, 0:0. Whereas if I append the new cell into section: row:1, this method gets called with section:row 0:0, 0:1, 0:0, 0:1.</p>
  
  <p>What am I missing? I should be able to insert a row and catch it right? For some reason, I can't see section=0 row=1 come through a second time.</p>
  
  <p>-Luther </p>