---
title: "init(textCell:)"
framework: appkit
role: symbol
role_heading: Initializer
path: "appkit/nscell/init(textcell:)"
---

# init(textCell:)

Returns an NSCell object initialized with the specified string and set to have the cell’s default menu.

## Declaration

```swift
init(textCell string: String)
```

## Parameters

- `string`: The initial string to use for the cell.

## Return Value

Return Value An initialized NSCell object, or nil if the cell could not be initialized.

## Discussion

Discussion If no field editor (a shared NSText object) has been created for all NSCell objects, one is created. This is one of four designated initializers you must implement when subclassing. See Designated Initializers for the complete list.

## See Also

### Initializing a Cell

- [init(imageCell:)](appkit/nscell/init(imagecell:).md)
