title: <NSInternalInconsistencyException> Invalid update: invalid number of sections
body: <p>I am adding user defined text in a UItableView via a modal view controller. 
  The table is created as a NSMutableArray. on entering data in the modal view and tapping a Done button a  Invalid update: invalid number of sections.  error is generated.
  I must update the array when the user enters data but not sure how to do that. I have attached the relevant code. Thanks for your advice.</p>
  
  <pre><code>//Number of sections
  - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } 
  //Number of rows
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  {
      return  [listOfConjProcedures count];
  }
  
  //Loading the cells
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      static NSString *CellIdentifier = @"Cell";
  
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  
      if (cell == nil) {
          cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
  
      }
  
      // Configure the cell.
  
      cell.textLabel.text = [listOfConjProcedures objectAtIndex:indexPath.row];
  
      return cell;
  }
  
  //Done button Delegate for the modal view
  - (void)itemDetailViewController:(ItemDetailViewController *)controller didFinishAddingItem:(ChecklistItem *)item
  {
      int newRowIndex = [listOfConjProcedures indexOfObject:item];
      [listOfConjProcedures addObject:item];
  
      NSIndexPath *indexPath = [NSIndexPath indexPathForRow:newRowIndex inSection:0];
      NSArray *indexPaths = [NSArray arrayWithObject:indexPath];
      [self.tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationAutomatic];
      [self dismissViewControllerAnimated:YES completion:nil];
  
  }
  </code></pre>