title: Why does an empty tableView check the number of sections but a non-empty one does not?
body: <p>I have set up a demo application with a simple <code>UITableViewController</code> with no contents, but an 'Add' button in the toolbar. This launches a modal view controller which is again empty other than a 'cancel' button. The cancel button just tells its <code>delegate</code> (the <code>UITableViewController</code>) to dismiss the modal.</p>
  
  <p>I then added an <code>NSLog</code> statement in the <code>UITableViewController</code>'s <code>numberOfSectionsInTableView</code> method.</p>
  
  <p>Ordinarily, when the table view controller loads I see two calls to <code>numberOfSectionsInTableView</code>. When I open and dismiss the modal (which returns to the <code>UITableViewController</code>) I see no further calls to <code>numberOfSectionsInTableView</code>.</p>
  
  <p>However, if I return <code>0</code> from <code>numberOfSectionsInTableView</code>, in addition to the two calls on display, I also see an additional numberOfSections call when the modal is dismissed.</p>
  
  <p>This only happens when <code>numberOfSectionsInTableView</code> returns <code>0</code>, and I have added no additional code to my project besides that mentioned. This is easily verifiable by setting up a couple of controllers as I've described and modifying the result from <code>numberOfSectionsInTableView</code>.</p>
  
  <p>My questions:</p>
  
  <ul>
  <li>Why is the <code>UITableView</code> calling <code>numberOfSectionsInTableView</code> on return from a modal view?</li>
  <li>Why is it only doing this if <code>numberOfSectionsInTableView</code> returns <code>0</code>?</li>
  <li>In addition to <code>numberOfSectionsInTableView</code>, the <code>UITableViewController</code> is also calling <code>cellForRowAtIndex:</code> when the modal is dismissed. In fact, it is attempting to display the new contents of its <code>dataSource</code>. How am I meant to manually animate a row insertion if the first row added is going to already be updated automatically? Shouldn't it be left to me to make sure that my <code>UITableView</code> is consistent with its <code>dataSource</code>?</li>
  <li>What property is the <code>UITableViewController</code> checking to know that there is one or more sections (and therefore ask my delegate how many sections)? It can't be <code>numberOfSectionsInTableView</code> itself, since I would see it called whenever I return from the modal, not only when numberOfSections = 0.</li>
  </ul>