<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCell/init(textCell:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCell(im)initTextCell:"
  },
  "title" : "init(textCell:)"
}
-->

# init(textCell:)

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

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

## Parameters

`string`

The initial string to use for the cell.

## Return Value

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

## Discussion

If no field editor (a shared [`NSText`](/documentation/AppKit/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`](/documentation/AppKit/NSCell#Designated-Initializers) for the complete list.

---

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)