Default Tableview - deleting sections
<p>My application contains a table view with rows and sections.<br />
When I delete the last item of a section, I delete the section. It works fine.<br />
But, when i move the last row of a section into another section, I get an error.</p>

<p>Here is my code in both cases :</p>

<pre><code>[categoryArray removeObjectAtIndex:indexPath.section];
[tableView deleteSections:[NSIndexSet indexSetWithIndex:indexPath.section] withRowAnimation:UITableViewRowAnimationTop];
</code></pre>

<p>Here is the error that occurs in moveRowAtIndexPath:fromIndexPath:toIndexPath:</p>

<pre><code>2009-03-11 17:56:09.524 Test[5140:20b] 1
2009-03-11 17:56:09.525 Test[5140:20b] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFArray objectAtIndex:]: index (5) beyond bounds (5)'
</code></pre>

<p>Any help would be great ! </p>
