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

# NSTableHeaderCell

An object that a table header view uses to draw the content of the column headers.

```
class NSTableHeaderCell
```

## Overview

Subclasses of the `NSTableHeaderCell` class can override the [`drawInterior(withFrame:in:)`](/documentation/AppKit/NSCell/drawInterior(withFrame:in:)), [`edit(withFrame:in:editor:delegate:event:)`](/documentation/AppKit/NSCell/edit(withFrame:in:editor:delegate:event:)), and [`highlight(_:withFrame:in:)`](/documentation/AppKit/NSCell/highlight(_:withFrame:in:)) methods to change the way headers appear. This specific subclass is responsible for drawing the sort indicators. See the [`NSCell`](/documentation/AppKit/NSCell) class specification for information on overriding these methods.

See the [`NSTableView`](/documentation/AppKit/NSTableView) and [`NSTableHeaderCell`](/documentation/AppKit/NSTableHeaderCell) for more information.

## Topics

### Drawing Sorting Indicators

[`-  drawSortIndicatorWithFrame:inView:ascending:priority:`](/documentation/AppKit/NSTableHeaderCell/drawSortIndicator(withFrame:in:ascending:priority:))

Draws a sorting indicator given a cell frame contained inside a view.

[`-  sortIndicatorRectForBounds:`](/documentation/AppKit/NSTableHeaderCell/sortIndicatorRect(forBounds:))

Returns the location to display the sorting indicator given `theRect`.

## Relationships

### Inherits From

[`NSTextFieldCell`](/documentation/AppKit/NSTextFieldCell)

### Conforms To

[`NSAccessibilityProtocol`](/documentation/AppKit/NSAccessibilityProtocol)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Hashable`](/documentation/Swift/Hashable)

[`NSUserInterfaceItemIdentification`](/documentation/AppKit/NSUserInterfaceItemIdentification)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`Sendable`](/documentation/Swift/Sendable)

[`NSAccessibilityElementProtocol`](/documentation/AppKit/NSAccessibilityElementProtocol)

[`NSCoding`](/documentation/Foundation/NSCoding)

---

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)