Re: Crash when using [NSTimer fire]
Re: Crash when using [NSTimer fire]
- Subject: Re: Crash when using [NSTimer fire]
- From: "John C. Randolph" <email@hidden>
- Date: Fri, 19 Nov 2004 15:04:00 -0800
On Nov 19, 2004, at 9:55 AM, Gwynne wrote:
On Nov 19, 2004, at 12:39 PM, Shawn Erickson wrote:
Why are using using a timer that way? I don't follow how a timer of 5
years is useful...
Guessing at what you are attempting to do... consider using an
NSConditionLock or some such thing if you are trying to gate
something from running, etc.
It's not always used that way. The timer has a variable interval.
There's no public API for changing a timer's interval. Are you
actually changing the interval, or are you creating a new timer when
you want one with a different interval?
The 5-year interval is used when the associated UI object has been
disabled so that I don't have to keep checking whether or not the
timer exists. It's a convenience.
If you're checking whether the timer exists at all, then something's
not right in your design. What you should do, is remove any timers
when the UI gets disabled, and add one when it gets enabled.
-jcr
John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
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