I want to enable editing for a single cell in a Table View at the selected index of a long press event, everything works except it enables editing for the entire table. How can I enable editing only on the cell that is selected?
-(void)handleLongPress:(UILongPressGestureRecognizer *)gestureRecognizer {
CGPoint p = [gestureRecognizer locationInView:self.savedPropertyTableView];
NSIndexPath *indexPath = [self.savedPropertyTableView indexPathForRowAtPoint:p];
if (indexPath == nil) {
[self setEditing:YES animated:YES];
NSLog(@"long press on table view but not on a row");
}
else {
[self setEditing:YES animated:YES];
NSLog(@"long press on table view at row %d", indexPath.row);
}
}