bycopy in and NSDistantObject in return
bycopy in and NSDistantObject in return
- Subject: bycopy in and NSDistantObject in return
- From: Claudio Procida <email@hidden>
- Date: Wed, 21 Feb 2007 19:25:40 +0100
I'm using DO to communicate with a worker thread. At a certain point,
the worker thread returns an array to the owner with the following
method:
@protocol SGWorkerOwner
//...
- (oneway void)setTree:(bycopy in id)tree;
//...
@end
According to the Objective-C Programming Language guide, Remote
Messaging:
"There are times when proxies may be unnecessarily inefficient, when
it’s better to send a copy of the object to the remote process so
that it can interact with it directly in its own address space. To
give programmers a way to indicate that this is intended, Objective-C
provides a bycopy type modifier [...] bycopy makes so much sense for
certain classes—classes that are intended to contain a collection of
other objects, for instance—that often these classes are written so
that a copy is sent to a remote receiver, instead of the usual
reference"
What is not clear to me is if why, if I ask for a copy of the tree
object, the receiver gets a NSDistantObject:
- (oneway void)setTree:(bycopy in id)tree
{
NSLog(@"%@ (%@)", [tree objectAtIndex:0], [[tree objectAtIndex:0]
class]);
2007-02-21 19:11:43.361 Singular[16991] <SGDuplicateTreeNode:
0x4859c60> (<NSDistantObject: 0xa295aa18>)
Maybe I didn't get it ... can someone please explain me what am I
doing wrong?
TIA,
--
Claudio Procida
Emeraldion Lodge
http://www.emeraldion.it
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden