title: Error trying to update number of rows in my table view
body: <p>Im a little bit confused about how to add rows to the table view. </p>
  
  <p>I have an array which gets values added to it regularly. I am trying to update the number of rows everytime a new value is added to the array using these lines of code:</p>
  
  <pre><code>// listOfMembers if a 
  [[self tableView] beginUpdates];     [tableView numberOfRowsInSection:[listOfMembers count]];
  [[self tableView] endUpdates];
  
  [[self tableView] beginUpdates];
  [tableView reloadRowsAtIndexPaths:[tableView indexPathsForVisibleRows] withRowAnimation:UITableViewRowAnimationNone];
  [[self tableView] endUpdates];
  </code></pre>
  
  <p>however this does not work to change the number of rows.. may i am misunderstanding how the table updates. I get this error:</p>
  
  <pre><code>*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 0.  The number of rows contained in an existing section after the update (5) must be equal to the number of rows contained in that section before the update (4), plus or minus the number of rows inserted or deleted from that section (0 inserted, 0 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out).'
  </code></pre>
  
  <p>THe crash is on the line:</p>
  
  <pre><code>[tableView reloadRowsAtIndexPaths:[tableView indexPathsForVisibleRows] withRowAnimation:UITableViewRowAnimationNone];
  </code></pre>
  
  <p>How should I be updating my table view clearly I am doing this in the wrong way. </p>