1.第一种方法
- (void)btnActionForUserSetting:(id) sender {
NSIndexPath *indexPath = [self.tableViewindexPathForSelectedRow];
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
}
2.第二种方法- (void)deleteCellWithButton:(UIButton *)button {
//1.获取到删除的行数
HDAddDiagnosisTableViewCell *cell = (HDAddDiagnosisTableViewCell *)button.superview.superview;
NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
NSLog(@"delete:%ld",(long)indexPath.row);
//2.执行删除操作
}