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

# deselectColumn(_:)

Deselects the column at the specified index if it’s selected.

```
func deselectColumn(_ column: Int)
```

## Parameters

`column`

The index in the [`tableColumns`](/documentation/AppKit/NSTableView/tableColumns) array of the column to deselect.

## Discussion

Deselects the column at `columnIndex` if it’s selected, regardless of whether empty selection is allowed.

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

If the indicated column was the last column selected by the user, the column nearest it effectively becomes the last selected column. In case of a tie, priority is given to the column on the left.

This method doesn’t check with the delegate before changing the selection.

## See Also

[`- (void) selectRow:(NSInteger) row byExtendingSelection:(BOOL) extend;`](/documentation/AppKit/NSTableView/selectRow:byExtendingSelection:)

Selects a row at the specified index, optionally extending any existing selection.

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

A Boolean value indicating whether the table view allows the user to select zero columns or rows.



---

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)