---
title: deselectAllCells()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nsmatrix/deselectallcells()
---

# deselectAllCells()

Deselects all cells in the receiver and, if necessary, redisplays the receiver.

## Declaration

```swift
func deselectAllCells()
```

## Discussion

Discussion If the selection mode is NSRadioModeMatrix and empty selection is not allowed, this method does nothing.

## See Also

### Related Documentation

- [mode](appkit/nsmatrix/mode-swift.property.md)
- [allowsEmptySelection](appkit/nsmatrix/allowsemptyselection.md)

### Selecting and Deselecting Cells

- [selectCell(atRow:column:)](appkit/nsmatrix/selectcell(atrow:column:).md)
- [selectCell(withTag:)](appkit/nsmatrix/selectcell(withtag:).md)
- [selectAll(_:)](appkit/nsmatrix/selectall(_:).md)
- [keyCell](appkit/nsmatrix/keycell.md)
- [setSelectionFrom(_:to:anchor:highlight:)](appkit/nsmatrix/setselectionfrom(_:to:anchor:highlight:).md)
- [deselectSelectedCell()](appkit/nsmatrix/deselectselectedcell().md)
