美文网首页
tableViewcell上点击删除按钮,对此cell进行删除

tableViewcell上点击删除按钮,对此cell进行删除

作者: Mrxiaowang | 来源:发表于2017-12-05 16:43 被阅读174次

#pragma mark---删除地址按钮的点击方法

-(void)deleteClick:(UIButton *)btn WithEvent:(id)event{

NSLog(@"tag值---%ld",btn.tag);

NSSet *touches =[event allTouches];

UITouch *touch =[touches anyObject];

CGPoint currentTouchPosition = [touch locationInView:self.myTableView];

NSIndexPath *indexPath= [self.myTableView indexPathForRowAtPoint:currentTouchPosition];

[self.myTableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];

[self.placeArr removeObjectAtIndex:btn.tag];

//刷新第一组

NSIndexSet *indexSet = [[NSIndexSet alloc] initWithIndex:1];

[self.myTableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationNone];

}

相关文章

网友评论

      本文标题:tableViewcell上点击删除按钮,对此cell进行删除

      本文链接:https://www.haomeiwen.com/subject/jopcixtx.html