Sharing objects between threads
Sharing objects between threads
- Subject: Sharing objects between threads
- From: "Mike O'Connor" <email@hidden>
- Date: Fri, 25 Jun 2004 00:15:07 -0400
I have several objects I want to share between two threads. Locking is
not the problem, rather I keep running into "NSDistantObject access
attempted from another thread" errors.
I have some objects (classes) I've created, and I place them into an
NSArray. Then I pass that array as the withObject argument to
detachNewThreadSelector.
My thread gets the array ok, but when I try to use one of the objects
[myObjectFromArray message], I get the distant object error.
What's the proper way to share several objects between threads? Can't I
just move the id across somehow and use it, since it's all in the same
app, without it changing into a distant object?
_______________________________________________
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.