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

# selectCell(atRow:column:)

Selects the cell at the specified row and column within the receiver.

```
func selectCell(atRow row: Int, column col: Int)
```

## Parameters

`row`

The row of the cell to select.

`col`

The column of the cell to select.

## Discussion

If the specified cell is an editable text cell, its text is selected. If either `row` or `column` is –1, then the current selection is cleared (unless the receiver is an `NSRadioModeMatrix` and doesn’t allow empty selection). This method redraws the affected cells.

## See Also

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

The selection mode of the receiver.

[`-  selectCell:`](/documentation/AppKit/NSControl/selectCell(_:))

Selects the specified cell and redraws the control as needed.

[`allowsEmptySelection`](/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)