Yesterday my latest iOS build ran free of warnings on Xcode. Following an upgrade to Version 9.3 (9E145) overnight I got multiple warnings. When I tried self->score
following an answer (1) to a similar question the warnings disappeared.
But in a more recent answer (2) to the same question the problem is solved by altering settings. Currently my settings for Apple LLVM 9.0 - Warnings -Objective C and ARC
are
Implicit retain of ‘self’ within blocks Yes
But I don’t understand what Block implicitly retains 'self'
means in the context of the code below so I can't say whether or not this behaviour is ‘intended’. Or whether I solved a problem or simply hid it. Or whether answer 1 would be better than answer 2.
Could someone kindly explain what Block implicitly retains 'self'
means in this context ? Thanks.
score.alpha = 1.0;
if (sequenceState >= STATES_Count)
{
[GraphicScore animateWithDuration:8.0f
delay:1.0f
options:UIViewAnimationOptionCurveEaseOut
animations:^{self->score.alpha = 0.0;} // animations:^{score.alpha = 0.0;}
completion:^(BOOL finished){ }];
}
[self addSubview:score];