iOS 23-自定义cell上的button点击事件.

1.在cell里,.h写一个Block.

@property (nonatomic,copy)void(^telephoneBlock)();
2. 在cell里,.m写一个点点击事件.

- (IBAction)didclickPhone:(id)sender {
    
    if (self.telephoneBlock) {
        self.telephoneBlock();
    }
}

3.在- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

        cell.telephoneBlock=^(){
         
            NSLog(@"phonenumber is ======%@",shopmodel.phone);
        };

原文地址:https://www.cnblogs.com/ytmaylover/p/5062611.html