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

2017-12-05  本文已影响174人  Mrxiaowang

#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];

}

上一篇 下一篇

猜你喜欢

热点阅读