Re: Problems with NSTimer and NSRunLoop/CFRunLoop
Re: Problems with NSTimer and NSRunLoop/CFRunLoop
- Subject: Re: Problems with NSTimer and NSRunLoop/CFRunLoop
- From: Mont Rothstein <email@hidden>
- Date: Thu, 6 Jan 2005 19:14:29 -0800
John and Brendan, thanks for your suggestions.
John,
No, I didn't realize that CF is open source. I may just have to go see
if the timer and run loop stuff is.
As Brendan pointed out, the call being made to NSTimer is supposed to
add the timer to the run loop for me, and in fact it does in another
scenario.
Brendan,
I hadn't even though of a PoseAs, great idea.
I know that the timer has not been added because I have printed our the
description for the run loop, which includes all of the modes.
My problem occurs in a process that was created via fork(). Your
comment about being in another thread makes me wonder if this could
somehow be related. Are you aware of any issues with fork() and
NSRunLoops?
Thanks again,
-Mont
On Jan 6, 2005, at 6:45 PM, Brendan Younger wrote:
On Jan 6, 2005, at 8:32 PM, John Stiles wrote:
Unnecessary how?
If you don't attach your timer to a run loop in a mode, it doesn't
run, period.
True, but -[NSTimer
scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:]
automatically adds itself to the current run loop for the default
mode. -[NSTimer timerWithTimeInterval:etc.] doesn't add itself and
needs to be added manually. The original poster was using -[NSTimer
scheduledTimerWithTimeInterval:etc.].
To Mont Rothstein: if "performExpirationCheck:" is meant to be called
while a modal window is up in your application, you need to add the
timer to the run loop for NSModalPanelRunLoopMode since -[NSTimer
scheduledTimerWithTimeInterval:] adds itself for only
NSDefaultRunLoopMode.
Brendan Younger
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden