title: Call moveRowAtIndexPath from TableViewController
body: <p>I implemented the body of the method moveRowAtIndexPath:toIndexPath: as follows:</p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
  {
      XYZToDoItem *itemToMove = [self.toDoItems objectAtIndex:fromIndexPath.row];
      NSLog(@"Moving");
      NSLog( itemToMove.itemName);
  
      [self.toDoItems removeObjectAtIndex:fromIndexPath.row];
      [self.toDoItems insertObject:itemToMove atIndex:toIndexPath.row];
  }
  </code></pre>
  
  <p>I'd like to call this method from TableViewController's <code>didSelectRowAtIndexPath</code> method.</p>
  
  <p>When I do the rows of the table do move, but the above method doesn't seem to execute. Nothing logs to the console and the items in the array <code>toDoItems</code> DO NOT swap.</p>
  
  <p>Here's the body of that method:</p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
      NSIndexPath *indexPathOfLastItem =
      [NSIndexPath indexPathForRow:([self.toDoItems count] - 1) inSection:0];
  
      [tableView moveRowAtIndexPath:indexPath toIndexPath:indexPathOfLastItem];
  }
  </code></pre>
  
  <p>How do I get the table view to move rows properly from within the delegate (the TableViewController)?</p>