• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
bycopy in and NSDistantObject in return
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: bycopy in and NSDistantObject in return
      • From: "Adam R. Maxwell" <email@hidden>
  • Prev by Date: Re: Accessing programatically to attribute length in run-time
  • Next by Date: Re: When does -[NSWindow sendEvent:] beep? [solved]
  • Previous by thread: -[NSDocument writeToURL:...:error:], NSError and documents being renamed
  • Next by thread: Re: bycopy in and NSDistantObject in return
  • Index(es):
    • Date
    • Thread