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

# state

The cell’s current state.

```
var state: NSControl.StateValue { get set }
```

## Discussion

The [`NSOffState`](/documentation/AppKit/NSOffState) state indicates the normal or unpressed state. The [`NSOnState`](/documentation/AppKit/NSOnState) state indicates the alternate or pressed state. The [`NSMixedState`](/documentation/AppKit/NSMixedState) 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 [`NSOffState`](/documentation/AppKit/NSOffState), and a nonzero value is treated as [`NSOnState`](/documentation/AppKit/NSOnState). If the cell has three states, `0` is treated as [`NSOffState`](/documentation/AppKit/NSOffState), a negative value is treated as `NSMixedState`, and a positive value is treated as [`NSOnState`](/documentation/AppKit/NSOnState).

---

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)