olua.lib.Object└─ olua.lib.Proxy
I'm useful for particular constructions where you want one object to act like another object based on runtime considerations. For example, consider a button in a web application: a text-only button may be implemented as a simple HTML button, while a button with an image may have to be implemented as a complex DHTML object. My subclassing me, you can create a generic FlexibleButton class that can examine its parameters at run time and then become either an HTMLButton or a ImageButton by instantiating the appropriate object and setting it as the proxy target.
| Constructor Summary |
|---|
|
| Method Summary |
|---|
|
| Method Detail |
|---|
forwardInvocation: messageHandles a message on me.
Don't call this; it is used by the runtime.
message - the messageinitWithTarget: newtargetInitialises me to point at the given target.
newtarget - the new targetisProxyTest whether I am a proxy.
I am a proxy.
trueperformSelector: selector withArgs: argsCalls a method on the target.
selector - the (mangled) selectorargs - an array of argumentsproxyTargetReturns my current target.
respondsToSelector: selectorTests whether I respond to a given selector.
The default implementation passes the request on to the target.
selector - the (mangled) selectortrue or falsesetProxyTarget: newtargetChanges my current target.
newtarget - the new targettoStringReturns an identifier string describing me.