---
title: "tokenFieldCell(_:menuForRepresentedObject:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstokenfieldcelldelegate/tokenfieldcell(_:menuforrepresentedobject:)"
---

# tokenFieldCell(_:menuForRepresentedObject:)

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

## Declaration

```swift
@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

Return Value The menu associated with the  represented object.

## Discussion

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

## See Also

### Managing Menus for Represented Objects

- [tokenFieldCell(_:hasMenuForRepresentedObject:)](appkit/nstokenfieldcelldelegate/tokenfieldcell(_:hasmenuforrepresentedobject:).md)
