<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSMenu/item(withTag:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSMenu(im)itemWithTag:"
  },
  "title" : "item(withTag:)"
}
-->

# item(withTag:)

Returns the first menu item in the menu with the specified tag.

```
func item(withTag tag: Int) -> NSMenuItem?
```

## Parameters

`tag`

A numeric tag associated with a menu item.

## Return Value

The found menu item (an object conforming to the NSMenuItem protocol) or `nil` if the object couldn’t be found.

## See Also

[`indexOfItem(withTag:)`](/documentation/AppKit/NSMenu/indexOfItem(withTag:))

Returns the index of the first menu item in the menu identified by a tag.



---

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)