在tableviewcell上得控件的触发事件, 例如在cell上有按钮button,每个cell上都有,但是触发事件怎么才知道在哪个cell上触发呢。
这段代码就能知道按钮在哪个cell上被点击
ExperheTableViewCell *cell;
if([[UIDevice currentDevice].systemVersion doubleValue]>=8.0){
cell = (ExperheTableViewCell*)[[btn superview] superview];
}else{
cell = (ExperheTableViewCell*)[[[btn superview] superview]superview];
}
NSIndexPath*indexPath=[mainTable indexPathForCell:cell]