在 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;
                            
                                    Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
cell.zhozhao的允许交互方式要设置为yes。不过,你用拼音命名也是醉了。
打断点看你设置userInteractionEnabled属性点时候视图初始化了没