Re: nstimer not firing?
Re: nstimer not firing?
- Subject: Re: nstimer not firing?
- From: Uli Kusterer <email@hidden>
- Date: Sat, 10 Sep 2005 14:56:37 +0200
Am 07.09.2005 um 00:20 schrieb Luc Vandal:
I have a timer that I set in awakeFromNib but it's never firing:
Have you made sure you're running an event loop? NSTimers are
attached to a run loop ("scheduled") and you can't expect any timers
to fire unless you return control to a run loop (NSApplicationMain()
sets up a run loop automatically and calls your menu item actions
etc. from there).
If you are running your own run loop (e.g. in a modal dialog panel),
you must make sure the timer has been scheduled to run in the proper
run loop mode. There are different modes for "normal", "modal" and
"tracking the mouse", for instance, and by default timers are only
scheduled to run in the first mode.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
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