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

# NSFormCell

The `NSFormCell` class is used to implement text entry fields in a form. The left part of an `NSFormCell` object contains a title. The right part contains an editable text entry field.

```
class NSFormCell
```

## Overview

An `NSFormCell` object implements the user interface of an [`NSForm`](/documentation/AppKit/NSForm) object.

## Topics

### Initializers

[`init(coder:)`](/documentation/AppKit/NSFormCell/init(coder:))

### Initializing an NSFormCell

[`init(textCell:)`](/documentation/AppKit/NSFormCell/init(textCell:))

Returns an `NSFormCell` object initialized with the specified title string.

### Asking About a Cell’s Appearance

[`isOpaque`](/documentation/AppKit/NSFormCell/isOpaque)

A Boolean value indicating whether the title is empty and an opaque bezel is set.

### Accessing a Cell’s Title

[`attributedTitle`](/documentation/AppKit/NSFormCell/attributedTitle)

The title of the cell as an attributed string.

[`title`](/documentation/AppKit/NSFormCell/title)

The cell’s title text.

[`titleAlignment`](/documentation/AppKit/NSFormCell/titleAlignment)

The alignment of the title.

[`titleBaseWritingDirection`](/documentation/AppKit/NSFormCell/titleBaseWritingDirection)

The default writing direction used to render the form cell’s title.

[`titleFont`](/documentation/AppKit/NSFormCell/titleFont)

The font used to draw cell’s title.

[`titleWidth`](/documentation/AppKit/NSFormCell/titleWidth)

The width of the title field.

### Setting a Keyboard Equivalent

[`setTitleWithMnemonic:`](/documentation/AppKit/NSFormCell/setTitleWithMnemonic:)

Sets the cell title and mnemonic character.

### Asking About Placeholder Values

[`placeholderAttributedString`](/documentation/AppKit/NSFormCell/placeholderAttributedString)

The cell’s attributed placeholder string.

[`placeholderString`](/documentation/AppKit/NSFormCell/placeholderString)

The cell’s plain text placeholder string.

### Sizing for Auto Layout

[`preferredTextFieldWidth`](/documentation/AppKit/NSFormCell/preferredTextFieldWidth)

The preferred text field width.

### Instance Methods

[`titleWidth(_:)`](/documentation/AppKit/NSFormCell/titleWidth(_:))

Returns the width of the title field constrained to the specified size.



---

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)