---
title: target
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nstoolbaritem/target
---

# target

The object that defines the action method the toolbar item calls when clicked.

## Declaration

```swift
weak var target: AnyObject? { get set }
```

## Discussion

Discussion If you set this property to nil, the toolbar item attempts to execute its action method on the first responder. If the first responder doesn’t implement the action method, it forwards the request up the responder chain. If you assign a custom view to the toolbar item, modifying this property updates the target property of the view, if one exists. If the item doesn’t contain a custom view, the toolbar item manages the target object directly.

## See Also

### Performing the item’s action

- [action](appkit/nstoolbaritem/action.md)
