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

# tokenFieldCell(_:displayStringForRepresentedObject:)

Allows the delegate to provide a string to be displayed as a proxy for the represented object.

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

## Parameters

`tokenFieldCell`

The token field cell that sent the message.

`representedObject`

A represented object of the token field cell.

## Return Value

The string to be used as a proxy for `representedObject`. If you return `nil` or do not implement this method, then `representedObject` is displayed as the string.

## See Also

[`func tokenField(NSTokenField, displayStringForRepresentedObject: Any) -> String?`](/documentation/AppKit/NSTokenFieldDelegate/tokenField(_:displayStringForRepresentedObject:))

Allows the delegate to provide a string to be displayed as a proxy for the given represented object.



---

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)