OK, this code on ARC holds self inside the block:
dispatch_async(someQ, ^{
[self doSomething];
});
and that can be solved by
__weak MyRequest *weakSelf = self;
dispatch_async(someQ, ^{
[weakSelf doSomething];
});
but what if doSomething has a lot of references to self? Because doSomething code will run inside the block isn't the same of all code of doSomething is on the block directly?
Do I need to pass weakSelf to doSomething so the method can use weakself references instead of self? Something like
__weak MyRequest *weakSelf = self;
dispatch_async(someQ, ^{
[weakSelf doSomethingUsingThisSelf:weakself];
});
doSomethingis already called on the weak reference. - rmaddyselfinside thedoSomethingmethod? - rmaddydoSomethingwhich you haven't provided. - rmaddy