Solving NSTimer's circular reference problem using blocks in iOS development
Copyright: This is an original post by the blogger and may not be reproduced without the blogger's permission. https://blog.csdn.net/u010105969/article/details/80313441
Circular reference issues.
Using an NSTimer object as a property of a controller, the current VC makes a strong reference to the NSTimer object. When the NSTimer is created to cash in, the NSTimer object in turn takes the current VC as its target, at which point the NSTimer object makes a strong reference to the current VC, thus creating a circular reference between the NSTimer and the current VC, which prevents both the VC and the NSTimer from being freed and eventually leads to a memory leak.