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

# column(withIdentifier:)

Returns the index of the first column in the table view whose identifier is equal to the specified identifier.

```
func column(withIdentifier identifier: NSUserInterfaceItemIdentifier) -> Int
```

## Parameters

`identifier`

A column identifier.

## Return Value

The index in the [`tableColumns`](/documentation/AppKit/NSTableView/tableColumns) array of the first column in the table view whose identifier is equal to `anObject` (when compared using `isEqual:`), or `–1` if no columns are found with the specified identifier.

---

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)