Objective C - Forwarding
- You want to provide certain functionality but delegate actual implementation.
- You want to implement a proxy for a remote object without having to customize/subclass it for each type of object
Solution: override NSObject's
forwardInvocation: message.
- Last-chance message which is called when a message with no handler is passed.
- Not reflected in
respondsTo: - Default implementation (in NSObject) raises an exception
- Typically, will check delegate object for
respondsTo:before passing on the invocation