Capturing 'self' strongly in this block is likely&n

block 是代码块的意思。 甲里引用乙,乙里引用甲,就会导致 “retain cycle” -- “形成怪圈”的错误。

_customBarView.CallBack=^(UIButton *sender, NSInteger i){
        [self  jump:sender and:i];
    };

​```

self 转换一下加上__block字段就不会被retain了

__block creatTabBarController *controller = self;

_customBarView.CallBack=^(UIButton *sender, NSInteger i){

    [controller jump:sender and:i];
};

你可能感兴趣的:(Capturing 'self' strongly in this block is likely&n)