---
title: "invokeWithTarget:"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsinvocation/invokewithtarget:"
---

# invokeWithTarget:

Sets the receiver’s target, sends the receiver’s message (with arguments) to that target, and sets the return value.

## Declaration

```occ
- (void) invokeWithTarget:(id) target;
```

## Parameters

- `target`: The object to set as the receiver’s target.

## Discussion

Discussion You must set the receiver’s selector and argument values before calling this method.

## See Also

### Related Documentation

- [selector](foundation/nsinvocation/selector.md)
- [setArgument:atIndex:](foundation/nsinvocation/setargument:atindex:.md)
- [getReturnValue:](foundation/nsinvocation/getreturnvalue:.md)
- [target](foundation/nsinvocation/target.md)

### Dispatching an Invocation

- [invoke](foundation/nsinvocation/invoke.md)
