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

# deselectAllCells()

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

```
func deselectAllCells()
```

## Discussion

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

## See Also

[`var mode: NSMatrix.Mode`](/documentation/AppKit/NSMatrix/mode-swift.property)

The selection mode of the receiver.

[`var allowsEmptySelection: Bool`](/documentation/AppKit/NSMatrix/allowsEmptySelection)

A Boolean that indicates whether a radio-mode matrix supports an empty selection.



---

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)