Instance Method

methodSignatureForSelector:

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.

Declaration

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

Parameters

aSelector

The selector for which to return a method signature.

Return Value

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

Discussion

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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software