---
title: "deselectColumn(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstableview/deselectcolumn(_:)"
---

# deselectColumn(_:)

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

## Declaration

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

## Parameters

- `column`: The index in the doc://com.apple.appkit/documentation/AppKit/NSTableView/tableColumns array of the column to deselect.

## Discussion

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 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

### Related Documentation

- [allowsEmptySelection](appkit/nstableview/allowsemptyselection.md)

### Selecting Columns and Rows

- [selectColumnIndexes(_:byExtendingSelection:)](appkit/nstableview/selectcolumnindexes(_:byextendingselection:).md)
- [selectedColumn](appkit/nstableview/selectedcolumn.md)
- [selectedColumnIndexes](appkit/nstableview/selectedcolumnindexes.md)
- [numberOfSelectedColumns](appkit/nstableview/numberofselectedcolumns.md)
- [isColumnSelected(_:)](appkit/nstableview/iscolumnselected(_:).md)
- [selectRowIndexes(_:byExtendingSelection:)](appkit/nstableview/selectrowindexes(_:byextendingselection:).md)
- [selectedRow](appkit/nstableview/selectedrow.md)
- [selectedRowIndexes](appkit/nstableview/selectedrowindexes.md)
- [deselectRow(_:)](appkit/nstableview/deselectrow(_:).md)
- [numberOfSelectedRows](appkit/nstableview/numberofselectedrows.md)
- [isRowSelected(_:)](appkit/nstableview/isrowselected(_:).md)
- [selectAll(_:)](appkit/nstableview/selectall(_:).md)
- [deselectAll(_:)](appkit/nstableview/deselectall(_:).md)
