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];
});
doSomething
is already called on the weak reference. – rmaddyself
inside thedoSomething
method? – rmaddydoSomething
which you haven't provided. – rmaddy