Contents

NSTextFieldCell

An object that enhances the text display capabilities of a cell.

Declaration

class NSTextFieldCell

Overview

The NSTextFieldCell class adds to the text display capabilities of the NSCell class by allowing you to set the color of both the text and its background. You can also specify whether the cell draws its background at all.

All of the methods declared by this class are also declared by the NSTextField class, which uses NSTextFieldCell objects to draw and edit text. The NSTextField cover methods call the corresponding NSTextFieldCell methods.

Placeholder strings, set using the placeholderString or placeholderAttributedString property, appear in the text field cell if the actual string is nil or an empty string. They’re drawn in gray on the cell and aren’t archived in the “pre-10.2” nib format.

Designated Initializers

When subclassing NSTextFieldCell you must implement the designated initializers init(coder:) and init(textCell:).

Topics

Creating a Text Field Cell

Setting the Text Color

Setting the Bezel Style

Controlling the Background

Managing the Field Editor

Managing Placeholder Strings

Accessing Input Source Locales

See Also

Cell