Re: Problems with performSelector:withObject:afterDelay:
Re: Problems with performSelector:withObject:afterDelay:
- Subject: Re: Problems with performSelector:withObject:afterDelay:
- From: John Timmer <email@hidden>
- Date: Fri, 23 Jul 2004 11:10:08 -0400
None of the timed selector or NSTimer methods seem to have defined behavior
following sleep that I can find in the docs. In the real world, I've seen
pretty varied results depending on the method I used. In the end, what I
wound up doing was paying attention to when I woke up, and immediately clear
all the timers with:
[NSObject cancelPreviousPerformRequestsWithTarget: self];
You can then reset them to something reasonable. 10.3 includes an
NSWorkspace method for being alerted of waking from sleep, earlier than that
you need to link into IOKit (I can send you code for that if you need
backwards compatibility).
JT
>
I'm using the method in the subject to call a method every X minutes.
>
It works wonderfully. UNTIL, until I put the computer to sleep then
>
it's lost. It never steps back into the loop to call the method which
>
then calls itself after the aforementioned delay. Am I missing
>
something, is there a way to make sure that it'll start this loop up
>
again?
>
>
April.
_______________________________________________
This mind intentionally left blank
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.