objective c - Reset an NSTimer's firing time to be from now instead of the last fire -


I have a NSTimer that decreases with a value of 3 seconds interval Sets fire. When I do an action that increases the value, I want to restart the timer to count 3 seconds from that point. For example, if I increase the value and the timer will set fire in 1 second, then I want to change it and the timer fire should be done in 3 seconds. Can I invalidate the timer and make it again? Or can I do this with setFireDate: , using the current date and adding 3 seconds interval?

Yes, you can invalidate it and recreate it

You It can also be used by:

  - (zero) myTimedTask {// Other stuff is required to perform this task // Change variable variation 1 day or 3s or not. .. It can be an example variable or global which can be replaced by other parts of your app / WeStillWantTimer also has a similar variable that your app uses to prevent this recurring function if (HistilentTimer) [self Exhibitor: @selector (myTimedTask :) with-object: after gamer color: split della]; }  

To call the recurring task, you call my timed Task. Once started, you can change the delay when changing the delay or you can stop it with a stevenantimer.


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -