私有变量: NSString *private
_weak typeof(self) weakSelf = self;
myBlock = ^{
// 私有成员变量避免循环引用方法
__strong typeof(weakSelf) sweakSelf = weakSelf;
sweakSelf -> private = @"这样就不会了";
};
私有变量: NSString *private
_weak typeof(self) weakSelf = self;
myBlock = ^{
// 私有成员变量避免循环引用方法
__strong typeof(weakSelf) sweakSelf = weakSelf;
sweakSelf -> private = @"这样就不会了";
};
本文标题:block调用私有变量问题
本文链接:https://www.haomeiwen.com/subject/kspagttx.html
网友评论