title: How can I delete selected row from UITableView?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/14148229/change-table-to-edit-mode-and-delete-rows-inside-a-normal-viewcontroller">change Table to Edit mode and delete Rows inside a normal ViewController</a>  </p>
  </blockquote>
  
  
  
  <p>I want to delete selected row from tableView. I want to provide the functionality to the user to delete the row when he slips or flicks his finger on the row. I know the editing style which provides a circular red button with -ve sign on it.</p>
  
  <p>I have tried this code:</p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath 
  {
  
  
  [tableView beginUpdates];    
  if (editingStyle == UITableViewCellEditingStyleDelete) {
      // Do whatever data deletion you need to do...
      // Delete the row from the data source
      [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath, nil] withRowAnimation:UITableViewRowAnimationTop];      
  }       
  [tableView endUpdates];
  [tableView reloadData];
  }
  </code></pre>
  
  <p>I get the delete button but when I click it SIGABRT Error is there.</p>