我們在研發(fā)的過程中,為了避免循環(huán)引用常常會用weak若飲用來打破循環(huán)鏈
__weak typeof(self) weakSelf = self;
但是有時候,在異步多任務的時候,為了避免weakself提前被釋放,需要配合
__strong typeof(self) strongSelf = weakSelf;
__weak __typeof__(self) weakSelf = self;
dispatch_group_async(_operationsGroup, _operationsQueue, ^
{
__typeof__(self) strongSelf = weakSelf;
[strongSelf doSomething];
[strongSelf doSomethingElse];
} );