title: iOS: editingStyleForRowAtIndexPath when adding a new cell
body: <p>I'm adding a row to a UITableView section when the user switches the table to editing mode with this code:</p>
  
  <pre><code>- (void) setEditing:(BOOL) editing animated:(BOOL) animated {
      [super setEditing:editing animated:animated];
      if (editing) {
          [self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject: [NSIndexPath indexPathForRow:0 inSection:SECTION_SUPPLIERS]]   withRowAnimation:UITableViewRowAnimationFade];
      } 
  }
  </code></pre>
  
  <p>The object being to create a "Add new supplier ..." row. This works, however when the table wants to get the editing style so it can add a plus or minus icon, I have a problem. </p>
  
  <pre><code>- (UITableViewCellEditingStyle) tableView:(UITableView *) tableView editingStyleForRowAtIndexPath:(NSIndexPath *) indexPath {
      return ([self.tableView isEditing] &amp;&amp; indexPath.row == 0) ? UITableViewCellEditingStyleInsert : UITableViewCellEditingStyleDelete;
  }
  </code></pre>
  
  <p>The sequence seems to go like this:</p>
  
  <ol>
  <li>The table switches to editing. There is only one supplier row at this time so it queries for a editing style with row == 0.</li>
  <li>The insert of the new row is done which then triggers another query for an editing style again with a row == 0.</li>
  </ol>
  
  <p>So if I use this sequence and use the row number and tableView isEditing to decide on the editing style icon I end up with both the Add new and current supplier rows with plus icons on them. </p>
  
  <p>What is the best way to insert a row and assign the appropriate editing style - plus for the add new row, and minus for any other row?</p>