Cancel scheduled task when -done called to fix memory issues.
Could you elaborate more on what's the problem here?
I use - (void)hide:(BOOL)animated afterDelay:(NSTimeInterval)delay; to hide MBProgressHUD after, say, 15 seconds in my app. When I got a memory warning, in which case I want to purge my data immediately, I tried removing HUD from superview and releasing it. However, the -dealloc message doesn't come instantly but after several seconds. It seems like the system will hold the reference to the HUD under scheduled until it's done. So I tried canceling the scheduled task in the -done method and it works. The HUD will be dealloc right after it's removed from superview and released.
I'm not a native English speaker and this is my first time to do a pull request in GitHub, I beg I haven't done something wrong and I'm just trying my best to help. :)
- (void)hide:(BOOL)animated afterDelay:(NSTimeInterval)delay;