Instance Property

state

The cell’s current state.

Declaration

var state: NSControl.StateValue { get set }

Discussion

The offState state indicates the normal or unpressed state. The onState state indicates the alternate or pressed state. The mixedState state indicates that the feature represented by the control is in effect somewhere.

Although using the enumerated constants is preferred, you can also assign an integer value to this property. If the cell has two states, 0 is treated as offState, and a nonzero value is treated as onState. If the cell has three states, 0 is treated as offState, a negative value is treated as NSMixedState, and a positive value is treated as onState.

See Also

Managing Cell State

var allowsMixedState: Bool

A Boolean value indicating whether the cell supports three states instead of two.

var nextState: Int

The cell’s next state.

func setNextState()

Changes cell’s state to the next value in the sequence.