27. Proxies and Forwarding

Proxies are objects that stand in for other objects. They are used in any situation where an object is needed but the object is not readily available. For example, when distributed objects are used to provide object-oriented communication between applications, an actual object in one application may be represented as a proxy in another. Messages sent to the proxy are transmitted over the network and received by the actual object. Return values from the actual object are sent back over the network and returned by the proxy.

Forwarding is a feature of the Objective-C runtime that allows an object to capture messages sent to it and then pass these messages on to another object. Proxies use Forwarding in their implementation. ...

Get Cocoa Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.