Re: Problem with detached thread
Re: Problem with detached thread
- Subject: Re: Problem with detached thread
- From: Cameron Hayne <email@hidden>
- Date: Thu, 4 Jul 2002 04:26:27 -0400
On Thursday, July 4, 2002, at 03:02 am, Laurent Daudelin wrote:
So, I thought I would detach the lengthy operation in a new thread. The
problem is that based on some stuff processed by this operation, I need
to
display a window.
So, it seems to me that what you are asking is how to arrange to have
your main thread notified when the worker thread is done. The "official"
way to communicate between threads is via NSConnection but this seems
overly complicated for simple things like what you want to do.
But I don't see why you can't have some object send addObserver to the
defaultNotificationCenter in the main thread for some Notification that
you make up. And then have your worker thread postNotification when it
is done. I understand that notifications are received in the thread in
which the addObserver is done - i.e. in this case, the main thread.
... Cameron
--
Cameron Hayne (email@hidden)
Hayne of Tintagel
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.