---
title: "invocationWithMethodSignature:"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/nsinvocation/invocationwithmethodsignature:"
---

# invocationWithMethodSignature:

Returns an NSInvocation object able to construct messages using a given method signature.

## Declaration

```occ
+ (NSInvocation *) invocationWithMethodSignature:(NSMethodSignature *) sig;
```

## Parameters

- `sig`: An object encapsulating a method signature.

## Discussion

Discussion The new object must have its selector set with NSInvocation and its arguments set with setArgument:atIndex: before it can be invoked. Do not use the alloc/init() approach to create NSInvocation objects.

## See Also

### Related Documentation

- [Distributed Objects Programming Topics](apple-archive/documentation/Cocoa/Conceptual/DistrObjects.md)
