I have a gesture on a UITableViewCell subclass called ArticleCell, so when it is swiped a method in the UITableViewController class gets called to delete the cell that was swiped.
The delegate method looks like this:
- (void)swipedToRemoveCell:(ArticleCell *)articleCell {
NSIndexPath *indexPath = [self.tableView indexPathForCell:articleCell];
[self.tableView beginUpdates];
[self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
[self.tableView endUpdates];
[self.tableView reloadData];
}
But every time I swipe, I get this error:
Invalid update: invalid number of rows in section 0
More information: It uses Core Data for the data source, so it uses NSFetchedResultsController. Do I have to update something there? (I haven't touched any of its methods.)