在自定义的Cell中有一个按钮需要处理点击事件
[button addTarget:self action:@selector(tap:) forControlEvents:UIControlEventTouchUpInside];
直接在cellForRowAtIndexPath方法添事件点击没反应.
查资料通过这个方法搞定:
UIButton *button=(UIButton *)[cell viewWithTag:100];
[button addTarget:self action:@selector(tap:) forControlEvents:UIControlEventTouchUpInside];
[cell addSubview:button];