<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTokenFieldCellDelegate/tokenFieldCell(_:menuForRepresentedObject:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTokenFieldCellDelegate(im)tokenFieldCell:menuForRepresentedObject:"
  },
  "title" : "tokenFieldCell(_:menuForRepresentedObject:)"
}
-->

# tokenFieldCell(_:menuForRepresentedObject:)

Allows the delegate to provide a menu for the specified represented object.

```
@MainActor optional func tokenFieldCell(_ tokenFieldCell: NSTokenFieldCell, menuForRepresentedObject representedObject: Any) -> NSMenu?
```

## Parameters

`tokenFieldCell`

The token field cell that sent the message.

`representedObject`

A represented object of the token field.

## Return Value

The menu associated with the  represented object.

## Discussion

The returned menu should be autoreleased. By default tokens in a token field cell do not return menus.

---

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)