在 cellForRowAtIndexPath里定义cell
zhizhao为UIImageview,tapPhoto不管有无参数都没有任何响应。
代码如下:
CAPictureViewCell *caCell=[[NSBundle mainBundle]loadNibNamed:@"CAPictureViewCell" owner:self options:nil][0];
NSString *path = self.dic[@"imgpath"];
[caCell.zhizhao setUserInteractionEnabled:YES];
UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] init];
[recognizer addTarget:self action:@selector(tapPhoto)];
NSString* zhizhaoUrl = [path stringByAppendingString:self.dic[@"apliinfo"][@"business_licence_number_electronic"]];
[caCell.zhizhao setImageWithURL:[NSURL URLWithString:zhizhaoUrl] placeholderImage:PLACEHOLDER];
[caCell.zhizhao addGestureRecognizer:recognizer];
viewDidLoad方法里:
self.view.userInteractionEnabled = YES;
self.infoTable.userInteractionEnabled = YES;
cell.zhozhao的允许交互方式要设置为yes。不过,你用拼音命名也是醉了。