Re: Vended Object Setters
Re: Vended Object Setters
- Subject: Re: Vended Object Setters
- From: Justin Giboney <email@hidden>
- Date: Thu, 17 Apr 2008 10:19:57 -0600
Actually that didn't work... it appears to be setting it as I go
through the set method, but when I go to get it it is almost as if it
is calling an object in a different memory set.
I set up the protocol, and I am using bycopy.
Thanks,
Justin Giboney
On Apr 17, 2008, at 9:25 AM, Ken Thomases wrote:
On Apr 17, 2008, at 10:01 AM, Justin Giboney wrote:
bycopy worked, thank you.
Uh, OK. Glad it helped, but your original problem is still
mysterious. I don't know about you, but I don't like blindly fixing
things without understanding them.
Does this mean though that I need to duplicate all of methods, with
one set for internal commands and one for remote commands?
No.
The proper thing to do is to declare a protocol which describes the
interface that your vended object exposes. This protocol should be
in a header file that both the client and the server can include.
The protocol should have all of the type qualifiers that are
appropriate.
In the server, have the class of your vended object adopt the
protocol. However, you only need to implement each method once.
The use of type qualifiers in no way requires that you duplicate
methods. For uses internal to the server, the protocol and its type
qualifiers won't make any difference.
In the client, it is best to use -[NSDistantObject
setProtocolForProxy:] to help the D.O. system avoid some overhead.
If you don't do that, then D.O. has to discover the interface of the
vended object by querying the server.
Lastly, you might want to use NSProtocolChecker in the server if
your vended object has some methods that a client should not be able
to invoke.
-Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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