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

# clickedColumn

The index of the column the user clicked.

```
var clickedColumn: Int { get }
```

## Discussion

This property contains the index in the [`tableColumns`](/documentation/AppKit/NSTableView/tableColumns) array of the column that the user clicked. The value is `-1` when the user clicks in an area of the table view that is not occupied by columns or when the user clicks a row that is a group separator.

The value of this property is meaningful in the target object’s implementation of the action and double-action methods. You can also use the value to determine which contextual menu to display when the user Control-clicks in a table. Note that the `clickedColumn` value remains valid when the menu item sends the action message. To see an example of using `clickedColumn` in the implementation of a contextual menu, download the [DragNDropOutlineView: implementing drag and drop in an NSOutlineView](https://developer.apple.com/library/archive/samplecode/DragNDropOutlineView/Introduction/Intro.html#//apple_ref/doc/uid/DTS40008831) sample project.

## See Also

[`action`](/documentation/AppKit/NSControl/action)

The default action-message selector associated with the control.



---

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)