You can save the NSThread instance in an ivar (after alloc/init'ing it), and 
then use all the NSThread methods to figure out what to do.  (Don't forget to 
-start the thread when you're ready to kick it off)

Dave

On Oct 16, 2010, at 12:44 PM, Shane wrote:

> I have an application which launches worker threads via NSThread's
> detachNewThreadSelector: method, and once the thread is setup, it's
> listening for commands from the main GUI thread.
> 
> So, what I'd like to do is know how to check to see if a thread exists
> when a button is clicked where it would normally setup a new thread. I
> guess I could just send a command to the thread and try to get a
> response, and upon error, just assume that it should create a new
> thread. But I'd think there's a better way for checking thread
> existence.
> 
> Anyone have ideas on how to do this?

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to