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

# selectAll(_:)

Selects all rows or all columns, according to whether rows or columns were most recently selected.

```
func selectAll(_ sender: Any?)
```

## Parameters

`sender`

Typically the object that sent the message.

## Discussion

If the table allows multiple selection, this action method selects all rows or all columns, according to whether rows or columns were most recently selected. If nothing has been recently selected, this method selects all rows. If this table doesn’t allow multiple selection, this method does nothing.

If the selection does change, this method posts [`selectionDidChangeNotification`](/documentation/AppKit/NSTableView/selectionDidChangeNotification) to the default notification center.

As a target-action method, [`selectAll(_:)`](/documentation/AppKit/NSTableView/selectAll(_:)) checks with the delegate before changing the selection.

## See Also

[`allowsMultipleSelection`](/documentation/AppKit/NSTableView/allowsMultipleSelection)

A Boolean value indicating whether the table view allows the user to select more than one column or row at a time.

[`-  selectColumn:byExtendingSelection:`](/documentation/AppKit/NSTableView/selectColumn:byExtendingSelection:)

Selects the column at the specified index, optionally extending any existing 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)