To declare a vended object, you should first declare a protocol that
contains the methods you want to expose and that defines the methods
behaviors (bycopy, byref, in, out, etc...)
Then, you create a class that conforms to this protocol. You may omit
the bycopy, byref and other modifiers in your class interface.
@protocol MyProtocol
- (onway void)foo:(bycopy NSString *)bar;
@end
@interface VendedObject <MyProtocol>
- (void)foo:(NSString *)bar;
@end
And then, instead of vending your object directly, you may export a
protocol checker. This will prevent unexpected call of methods on your
vended object.
NSProtocolChecker *checker = [[NSProtocolChecker alloc]
initWithTarget:myVendedObject
protocol:@protocol(MyProtocol)];
[[NSConnection defaultConnection] setRootObject:checker];
[checker release];
Note that keywords like bycopy are ignored by the runtime for simple
methods calls and are usefull only when you send messages using a
proxy object, so you can safely call methods with thoses modifier
internaly.
Le 17 avr. 08 à 17:01, Justin Giboney a écrit :
bycopy worked, thank you.
Does this mean though that I need to duplicate all of methods, with
one set for internal commands and one for remote commands?
Thank
Justin Giboney
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
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:
http://lists.apple.com/mailman/options/cocoa-dev/devlists%40shadowlab.org
This email sent to [EMAIL PROTECTED]
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]