---
title: "setState(_:atRow:column:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsmatrix/setstate(_:atrow:column:)"
---

# setState(_:atRow:column:)

Sets the state of the cell at specified location.

## Declaration

```swift
func setState(_ value: Int, atRow row: Int, column col: Int)
```

## Parameters

- `value`: The value to assign to the cell.
- `row`: The row in which the cell is located.
- `col`: The column in which the cell is located.

## Discussion

Discussion For radio-mode matrices, if value is nonzero the specified cell is selected before its state is set to value. If value is 0 and the receiver is a radio-mode matrix, the currently selected cell is deselected (providing that empty selection is allowed). This method redraws the affected cell.

## See Also

### Related Documentation

- [state](appkit/nscell/state.md)
- [selectCell(atRow:column:)](appkit/nsmatrix/selectcell(atrow:column:).md)
- [allowsEmptySelection](appkit/nsmatrix/allowsemptyselection.md)

### Managing Attributes of Individual Cells

- [setToolTip(_:for:)](appkit/nsmatrix/settooltip(_:for:).md)
- [toolTip(for:)](appkit/nsmatrix/tooltip(for:).md)
