O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

NSDistantObject — Mac OS X 10.0

Synopsis

This subclass of NSProxy is used in distributed objects applications to locally represent objects that have been vended by a remote process. NSDistantObject operates by forwarding any messages it receives to the local NSConnection object, which then passes the invocation to the NSConnection object of the remote process. Return values received by the NSConnection object are passed to the message originator through the same instance of NSDistantObject that forwarded the message.

image with no caption

@interface NSDistantObject : NSProxy <NSCoding>
                                  // Initializers
   - (id)initWithLocal:(id)target 
                                 connection:(NSConnection *)connection;
   - (id)initWithTarget:(id)target 
                                 connection:(NSConnection *)connection;
                                  // Accessor Methods
   - (void)setProtocolForProxy:(Protocol *)proto;
                                  // Class Methods
   + (NSDistantObject *)proxyWithLocal:(id)target 
                                 connection:(NSConnection *)connection;
   + (NSDistantObject *)proxyWithTarget:(id)target 
                                 connection:(NSConnection *)connection;
                                  // Instance Methods
   - (NSConnection *)connectionForProxy;
                                  // Methods Implementing NSCoding
   - (void)encodeWithCoder:(NSCoder *)aCoder;
   - (id)initWithCoder:(NSCoder *)aDecoder;

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required