block的另一种传值写法

- (IBAction)popBtnAction:(CZRPopBtn *)sender {

    if (self.popViewBlock
        ) {
        self.popViewBlock(sender);
    }
    
}
        headerView.popViewBlock = ^(UIButton *btn){
            [weakSelf.view addSubview:weakSelf.alertView];
            
        };


1.    [self.headerview clickTheUpdatebtn:^{
        
        NSString *imgStr =  [self getIMGBsae64Str];
        if (!imgStr) {

2.-(void)clickTheUpdatebtn:(void(^)())Block;

3.@property (nonatomic, copy) void(^updateBtnBlock)();

4.-(void)clickTheUpdatebtn:(void (^)())Block
{
    if (self.updateBtnBlock != Block) {
        self.updateBtnBlock = Block;
    }
}



你可能感兴趣的:(block的另一种传值写法)