Simple question:
I have a repeating NSTimer (let's say it repeats once every minute).
My application resigns active and the user locks the phone for 15 minutes. The phone is asleep, I am not doing any secret tricks to keep it active like playing an inaudible sound or any开发者_Go百科thing.
When the user unlocks the phone and the application is restored to the foreground, does my timer fire 1 time or 15 times? I believe the answer is 1, I just want to make sure.
Thanks!
Yes. The Timing programming topic says
If the firing time is delayed so far that it passes one or more of the scheduled firing times, the timer is fired only once for that time period; the timer is then rescheduled, after firing, for the next scheduled firing time in the future.
精彩评论