Instance Method

initWithLocal:connection:

Initializes an NSDistantObject object as a local proxy for a given object.

Declaration

- (instancetype)initWithLocal:(id)target connection:(NSConnection *)connection;

Parameters

anObject

An object in the receiver’s address space.

aConnection

The connection for the returned proxy.

Return Value

An initialized NSDistantObject object that serves as a local proxy for anObject. If a proxy for anObject and aConnection already exists, the receiver is released and the existing proxy is retained and returned.

Discussion

Other applications connect to the proxy using the NSConnectionconnectionWithRegisteredName:host: class method.

Local proxies should be considered private to their NSConnection objects. Only an NSConnection object should use this method to create them, and your code shouldn’t retain or otherwise use local proxies.

This is the designated initializer for local proxies. It returns an initialized object, which might be different than the original receiver

See Also

Creating a Local Proxy

+ proxyWithLocal:connection:

Returns a local proxy for a given object and connection, creating the proxy if necessary.

Deprecated