Instance Method


Raises NSInvalidArgumentException. Override this method in your concrete subclass to return a proper NSMethodSignature object for the given selector and the class your proxy objects stand in for.


- (NSMethodSignature *)methodSignatureForSelector:(SEL)sel;



The selector for which to return a method signature.

Return Value

Not applicable. The implementation provided by NSProxy raises an exception.


Be sure to avoid an infinite loop when necessary by checking that aSelector isn’t the selector for this method itself and by not sending any message that might invoke this method.

For example, if your proxy merely forwards messages to an instance variable named realObject, it can implement methodSignatureForSelector: like this:

– (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector
    return [realObject methodSignatureForSelector:aSelector];

See Also

Handling Unimplemented Methods

- forwardInvocation:

Passes a given invocation to the real object the proxy represents.