---
title: "methodSignatureForSelector:"
framework: objectivec
role: symbol
role_heading: Instance Method
path: "objectivec/nsobject-swift.class/methodsignatureforselector:"
---

# methodSignatureForSelector:

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

## Declaration

```occ
- (NSMethodSignature *) methodSignatureForSelector:(SEL) aSelector;
```

## Parameters

- `aSelector`: A https://developer.apple.com/library/archive/documentation/General/Conceptual/DevPedia-CocoaCore/Selector.html#//apple_ref/doc/uid/TP40008195-CH48 that identifies the method for which to return the implementation address. When the receiver is an instance, aSelector should identify an instance method; when the receiver is a class, it should identify a class method.

## Return Value

Return Value An NSMethodSignature object that contains a description of the method identified by aSelector, or nil if the method can’t be found.

## Discussion

Discussion This method is used in the implementation of protocols. This method is also used in situations where an NSInvocation object must be created, such as during message forwarding. If your object maintains a delegate or is capable of handling messages that it does not directly implement, you should override this method to return an appropriate method signature.

## See Also

### Related Documentation

- [forwardInvocation:](objectivec/nsobject-swift.class/forwardinvocation:.md)

### Obtaining Information About Methods

- [method(for:)](objectivec/nsobject-swift.class/method(for:).md)
- [instanceMethod(for:)](objectivec/nsobject-swift.class/instancemethod(for:).md)
- [instanceMethodSignatureForSelector:](objectivec/nsobject-swift.class/instancemethodsignatureforselector:.md)
