BLOCK使用方法

来源:互联网 发布:linux系统破解wifi密码 编辑:程序博客网 时间:2024/05/02 04:33

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;
    };
0 0