iOS 多层block
程序员文章站
2022-03-03 12:46:54
...
- (void)setShiFangUpModel{undefined SFModel *model = [SFModel new]; __weak typeof(self) weakSelf = self; model.chuanZhiBlock = ^(NSString *title) {undefined __strong typeof(self) strongSelf = weakSelf;//第一层 strongSelf.titleLabel.text = title; __weak typeof(self) weakSelf2 = strongSelf; strongSelf.model.chuanZhiBlock = ^(NSString *title2) {undefined __strong typeof(self) strongSelf2 = weakSelf2;//第二层 strongSelf2.titleLabel.text = title2; }; };