Worker threads and UI threads
Worker threads and UI threads
- Subject: Worker threads and UI threads
- From: Chris DeSalvo <email@hidden>
- Date: Thu, 06 Jun 2002 20:03:31 -0700
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.