The row doesn't fade away in UITableView when deleting

ios, uitableview

Solution

You are actually passing the value which is deleted before, to the `DBHandler`. Check the code,

if (editingStyle == UITableViewCellEditingStyleDelete)
{
    DBHandler *handler ;
    [handler ResumeID:[mydataList objectAtIndex:indexPath.row]]; // Pass the object from the dataSource before deleting the object from the dataSource.

     [mydataList removeObjectAtIndex:indexPath.row]; // Remove object after passing it to the DBHandler
    NSLog(@"%ld",indexPath.row);
    // Animate the deletion from the table.
    [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}

Try this.

Problem

I am populating my iOS table view with the names of files inside my database. Everything is displayed in the tableView as expected. The problem comes when i delete it, it deleted the entries in the database but the entry doesn't fade away in the `UITableView`. Here is my code: ``` - (void)tableView:(UITableView *)tableView commitEditingStyle: (UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { DBHandler *handler; [handler ResumeID:[mydataList objectAtIndex:indexPath.row]]; //mydataList contains the array that contains name of all the entries in the DB and is displaying them on the tableview. [mydataList removeObjectAtIndex:indexPath.row]; NSLog(@"%ld",indexPath.row); // Animate the deletion from the table. [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; } } ```

Original source