title: Delete Row from Table view
body: <p>I am developing an IOS app. Delete the row in tableview and data load in core data in table view. When Click the delete button App crash.
      Reason is reason: <code>Invalid update: invalid number of rows in section 0.  The number of rows contained in an existing section after the update (18) must be equal to the number of rows contained in that section before the update (18), plus or minus the number of rows inserted or deleted from that section (0 inserted, 1 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out)...</code></p>
  
  <p>_fetchedobj is an NSArray to Fetch data from core data</p>
  
  <pre><code>//Code is
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  
      return _fetchedobj.count;
  }
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
      static NSString *MyIdentifier = @"MyReuseIdentifier";
      UITableViewCell *cell = [myTable dequeueReusableCellWithIdentifier:MyIdentifier];
      if (cell == nil) {
          cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault  reuseIdentifier:MyIdentifier];
      }
      data = [_fetchedobj objectAtIndex:indexPath.row];
      return cell;
  }
  
  -(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath*)indexPath {
      if (editingStyle == UITableViewCellEditingStyleDelete) {
          [tableView beginUpdates];
          NSManagedObject *managedObject = [_fetchedobj objectAtIndex:indexPath.row];
          [self.managedObjectContext deleteObject:managedObject];
          [myTable deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
          [myTable endUpdates];
      }
  }
  </code></pre>