I delete some rows in a UITableView as follows:
[tableView deleteRowsAtIndexPaths:toDelete withRowAnimation:UITableViewRowAnimationAutomatic]
This adds a nice animation to the delete operation.
However, after deleting, I need to update all currently visible lines. Call
[tableView reloadData]
right after the first call, but the nice animation effect has disappeared. What is the best way to do this? that is, revive the delete operation and update all currently visible rows? Thank!
The reason I need to do this is because each cell contains a checkbox. The controller of my view is the checkbox delegate, and each flag has an NSIndexPath associated with it. When the checkmark is switched, the delegate is called, telling him that we crossed for the x index path. Now, if some rows are deleted, the index paths should be updated. So I need to reload everything so that each flag knows where it is.
source
share