我想在长按事件的选定索引处启用表格视图中的单个单元格的编辑,除了它可以编辑整个表格之外,一切正常。如何仅在选定的单元格上启用编辑?
-(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);
}
}