DAProgressOverlayView
DAProgressOverlayView copied to clipboard
timer not set to nil after invalidated, result in memory leak!
timer not set to nil after invalidated, result in memory leak!
- (void)update
{
CGFloat animationProggress = self.animationProggress + DAUpdateUIFrequency / self.stateChangeAnimationDuration;
if (animationProggress >= 1.) {
self.animationProggress = 1.;
[self.timer invalidate];
self.timer = nil;// ADD THIS LINE RESOLVE THE ISSUE
} else {
self.animationProggress = animationProggress;
}
[self setNeedsDisplay];
}