【发布时间】:2013-06-10 21:00:41
【问题描述】:
假设我已经创建了一个弱自我使用
__weak typeof(self) weakSelf = self;
[self doABlockOperation:^{
...
}];
在该块内,如果我嵌套另一个块:
[weakSelf doAnotherBlockOperation:^{
[weakSelf doSomething];
}
它会创建一个保留周期吗?我需要创建另一个对weakSelf 的弱引用吗?
__weak typeof(self) weakerSelf = weakSelf;
[weakSelf doAnotherBlockOperation:^{
[weakerSelf doSomething];
}
【问题讨论】:
标签: ios memory-management automatic-ref-counting block retain-cycle