Type Method

instanceMethodForSelector:

Locates and returns the address of the implementation of the instance method identified by a given selector.

Declaration

+ (IMP)instanceMethodForSelector:(SEL)aSelector;

Parameters

aSelector

A Selector that identifies the method for which to return the implementation address. The selector must be non-NULL and valid for the receiver. If in doubt, use the respondsToSelector: method to check before passing the selector to methodForSelector:.

Return Value

The address of the implementation of the aSelector instance method.

Discussion

An error is generated if instances of the receiver can’t respond to aSelector messages.

Use this method to ask the class object for the implementation of instance methods only. To ask the class for the implementation of a class method, send the methodForSelector: instance method to the class instead.

See Also

Obtaining Information About Methods

- methodForSelector:

Locates and returns the address of the receiver’s implementation of a method so it can be called as a function.

+ instanceMethodSignatureForSelector:

Returns an NSMethodSignature object that contains a description of the instance method identified by a given selector.

- methodSignatureForSelector:

Returns an NSMethodSignature object that contains a description of the method identified by a given selector.

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