Re: Re: NSTimer firedate randomly changes
Re: Re: NSTimer firedate randomly changes
- Subject: Re: Re: NSTimer firedate randomly changes
- From: email@hidden
- Date: Thu, 18 Nov 2010 15:10:16 +0000
Thanks everyone for all the replies. I've read through the docs again (its
been years since I first set this up) and think I have a better
understanding of how timers should work. I see now that the timer will fire
once the computer is awakened from sleep, but it does take some time, maybe
twenty minutes or so from what I've seen so far. I've also noticed that the
timer does not fire during sleep though. Should it? From the replies and
the docs, it seems that it should, but I see no evidence of it either in
the console or the data.
On Nov 17, 2010 4:17pm, Greg Parker <email@hidden> wrote:
On Nov 17, 2010, at 2:12 PM, Kyle Sluder wrote:
On Wed, Nov 17, 2010 at 2:07 PM, Dave DeLong email@hidden> wrote:
Here's what I got from that documentation:
- An NSTimer is a run loop source.
Ah, I think this is where my brain went all funny, because the NSRunLoop
documentation mentions multiple times that "A timer is not considered an
input source."
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSRunLoop_Class/Reference/Reference.html
I suspect what is meant is that it's not considered an input source for
the purpose of deciding when to stop looping and return from the -run…
methods.
A timer is a "source" but not an "input source". "The Run Loop Sequence
of Events" says that both timers and port-based input sources are able to
wake a sleeping run loop.
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden