Re: Distributed Objects: Passing my objects to distant object
Re: Distributed Objects: Passing my objects to distant object
- Subject: Re: Distributed Objects: Passing my objects to distant object
- From: Rick Hoge <email@hidden>
- Date: Tue, 13 Jul 2004 08:55:16 -0400
Are there any special issues to consider in getting this to work? I
have been able to run simple methods like this (passing an NSNumber
or something) but when I use my own objects, I get crashes. Do I
have to implement my own coding protocols to be able to pass my
objects, which I gather must by value?
You need to support the NSCoding protocol, which allows your custom
classes to be serialized for transport and reconstructed on the other
side. Alternatively, you should be able to specify byref in your
protocol (used for communication), and then since you wouldn't need to
copy your classes, it should work. But I may be forgetting something,
so, ultimately your best bet is to read up on the DO doc's some more,
starting with the NSCoding stuff.
Thanks - this makes sense now. If I invoke my method on the distant
object using the 'byref' keyword, the method actually gets run on the
local (near) machine (since I suppose the messages are getting sent
back to my instance of the object?)
Should not be too hard to set up NSCoding for the two classes required
for this. I guess that will introduce some additional overhead but
hopefully not too much.
Rick
Wade Tregaskis (aim: wadetregaskis)
-- Sed quis custodiet ipsos custodes?
_______________________________________________
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.
_______________________________________________
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.