iOS中block的使用

1. 定义

typedef void(^BACK_BLOCK)(NSString*);
@property (nonatomic, strong) void(^block)(NSString *);

2.调用

self.block(@"dlflsdfl");

3.实现

 detailTableView.block = ^(NSString *text) {
        UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
        cell.detailTextLabel.text = text;
    };

你可能感兴趣的:(iOS中block的使用)