UITableViewCell里的UIImageView添加点击事件无响应,求助。

在 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;
查看回复