Re: Do I need to use Distributed Objects or not?
Re: Do I need to use Distributed Objects or not?
- Subject: Re: Do I need to use Distributed Objects or not?
- From: Dave Camp <email@hidden>
- Date: Wed, 9 Feb 2005 16:25:18 -0800
On Feb 9, 2005, at 10:23 AM, Evan Schoenberg wrote:
Dave,
The older Xcode 1.2 docs used to have some sample code in them for
using a custom NSNotificationCenter and a NSMachPort to send
NSNotifications between threads that would run at idle time, but that
seems to have been removed in the latest docs. I've seen the same
technique used by others as well. I can send you some source if you
want.
I'd appreciate seeing this sample code, as well. Could it be linked
on-list?
I've posted my lame code at:
<http://www.thinbits.com/ThreadNotification.zip>
It's based on the Apple sample which seems to not be available anymore.
I've also seen similar code on one of the Cocoa dev sites, so at least
I'm not the only one that thought it was useful. There are some
development notes and suggestions in the source.
Essentially, you allocate one of the ThreadNotificationObjects on the
thread that is to receive idle time notifications, and then post to
that object from other threads.
[center postNotification:@"foo!" object:NULL];
If you have multiple threads to send objects to, just allocate more
centers as needed...
Dave
_______________________________________________
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