<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSToolbarItem/target",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSToolbarItem(py)target"
  },
  "title" : "target"
}
-->

# target

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

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

## 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

  <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/validateToolbarItem:>



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)