Quote:
Originally Posted by RickMaddy
Why would you create an array of timers? Just have an array of delay values. Create a timer with the first delay. When it goes off create a new timer with the next delay, etc.
|
I think I need an array so I can keep a reference to individual timers. In my app, the user might tap a button to end the current screen and flip back to the main screen. In that event, I need to stop the timers that haven't fired yet.
I'm currently researching how to do the following in my code:
1. Detect if a timer still exists. Since I have this in an array, I should be able to check for null? Ex. if(timers[i]==NULL)
2. If a timer has not fired and the user wants to go back to the previous screen, get rid of the timer. [timers[i] invalidate]