Re: To thread or not to thread?
Re: To thread or not to thread?
- Subject: Re: To thread or not to thread?
- From: Dado Colussi <email@hidden>
- Date: Mon, 30 Jan 2006 11:05:16 +0200
Jeremy Hubbell wrote:
I have a simple function that randomly generates color values that I'd
like to execute when a checkbox is enabled and terminates when the
checkbox is unchecked. I tried a while loop using [sender state == 1]
Not to thread.
How about using an NSTimer to fire randomly? Set the first expiration
time randomly and the interval to some long time. When the timer
expires, it calls your handler function that does the color thing if the
checkbox is checked and otherwise does nothing. Then readjust the next
expiration time to a random time in the future at the end of your timer
handler function.
Good luck!
Dado
_______________________________________________
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