Ok, so I understand how to avoid self
retain cycles with blocks, how about cases when I send a message to self from a method within a block nested deeper in call stack like this:
- (void)methodA {
__block MyClass *blockSelf = self;
[someObject block:^{
[blockSelf methodB];
}];
}
- (void)methodB {
...
[self methodC];
...
}
- (void)methodC {
}
In this case [blockSelf methodB]
is fine, but is sending [self methodC]
from methodB
causing retain cycle or not? Can't find the answer anywhere...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With