Re: Worker threads and UI threads
Re: Worker threads and UI threads
- Subject: Re: Worker threads and UI threads
- From: Raphael Sebbe <email@hidden>
- Date: Fri, 7 Jun 2002 07:37:21 +0200
Check out
http://www.stepwise.com/Articles/Technical/2001-03-20.01.html
There you'll find how to do what you want using ports.
Raphael
On Friday, June 7, 2002, at 05:03 AM, Chris DeSalvo wrote:
My attempts to have a worker thread send updates to the main application
thread are still failing. Although the messages are getting sent (via
NSNotificationCenter) the receiver is always executing in the worker
thread's context. As such, all the UI code I'm calling is dying.
I tried replacing all of my uses of NSNotificationCenter with
NSDistributedNotificationCenter, and this did in fact get thing
executing in
the right context. However, only the first message ever made it
through and
I never got any more, even though I could see them being posted.
I then tried created my own private NSNotificationQueue and attaching
it to
the NSNotificationCenter of the main thread and having my worker thread
post
updates through that. No notifications ever came through at all.
Does anyone know of some working sample code that has a working thread
posting messages to the main app thread so that the main thread can
update
UI?
Thanks,
Chris
_______________________________________________
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.
_______________________________________________
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.