didSelectRowAtIndex没有开火

时间:2016-09-29 16:41:13

标签: ios objective-c uitableview custom-cell

我有UITableView个自定义UITableViewCell这是我的单元格的结构

enter image description here

除了角落红色按钮(Btn删除)之外,我已禁用每个UIButton的用户交互。我的问题是didSelectRowAtIndex委托没有解雇。数据加载也在发生我也从代码中设置了委托。

请帮帮我。 感谢

更新

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSIndexPath *previousIndexPath = selectedIndexPath;
if (indexPath == selectedIndexPath) {
    selectedIndexPath = nil;
} else {
    selectedIndexPath = indexPath;
}
NSMutableArray *indexPaths=[[NSMutableArray alloc] init];
NSIndexPath *previous=previousIndexPath;
[indexPaths addObject:previous];
NSIndexPath *current=selectedIndexPath;
[indexPaths addObject:current];
if ([indexPaths count]>0) {
    [_tblPendings reloadRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationFade];
}

}

0 个答案:

没有答案