I am sure this is covered in more detail on your iOS book but, I have been playing with the following method from the UITableViewDataSource protocol in an attempt to incorporate task deletion with swipe animaton.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
However, though it allows me to swipe to the left and it reveals the delete button, it seems to catch an exeption everytime I hit Delete (obviously I am not implementing the method properly). Can anyone give some insight? I plan to go through the iOS book eventually but would be nice to know what I could be doing wrong…
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
NSArray *deleteIndexPaths = [NSArray arrayWithObjects:indexPath, nil];
[tableView beginUpdates];
[tableView deleteRowsAtIndexPaths:deleteIndexPaths withRowAnimation:UITableViewRowAnimationFade];
[tableView endUpdates];
[self.taskTable reloadData];
[self.tasks removeObjectAtIndex:indexPath.item];
}