Panda Pig • Patty original or translated works. Welcome reprint, Reprint please indicate the source.
If you feel that the writing is not good please more advice, if you feel good please support a lot of praise. Thank you! Hopy;)
Disclaimer: All translations provided by this blog are from the Internet and are for learning and communication purposes only. Also, do not remove this statement when reproduced. In case of any dispute, there is no relationship between the blogger and the person who published the translation. Thank you for your cooperation!
Once a timer is created and added to a running loop (run loop), you can stop and release the timer through the invalidate instance method of the Nstimer class.
This will not only release the timer, but will also release any objects passed to the timer during the lifetime of the timer, if any.
For example, pass to ScheduledTimerWithTimeInterval:target:selector:userInfo:repeats: the UserInfo parameter in the instance method.
If you pass no to the repeats parameter, the timer will invalidate itself after the first pass and call, releasing any of its objects (if any)
After the invalidate call to Nstimer in iOS