I know that when we're using ARC and blocks, we should use __weak to prevent capturing strongly self and prevent a retain cycle ! But I was wondering if in the following example I need to use __weak ?
__weak MyViewController *weakSelf = self;
[self.personObject.gallery downloadLogoCompletionBlock:^(UIImage *image) {
if (image) {
weakSelf.logoImageView.image = image;
}];
Gallery is retaining the block not self, right ? If so I could write :
self.logoImageView.image = image;
Thanks for your answers
__weak
on which reference? – trojanfoeself
anyway, it might not be necessary. – trojanfoedownloadLogoCompletionBlock:
method? It will tell us if you are running into a retain cycle. – Pedro Mancheno