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

# tokenFieldCell(_:displayStringForRepresentedObject:)

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

## Declaration

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

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

### Related Documentation

- [Token Field Programming Guide](apple-archive/documentation/Cocoa/Conceptual/TokenField_Guide/Introduction.md)

### Displaying Tokenized Strings

- [tokenFieldCell(_:styleForRepresentedObject:)](appkit/nstokenfieldcelldelegate/tokenfieldcell(_:styleforrepresentedobject:).md)
