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

# sortDescriptors

The table view’s sort descriptors.

```
var sortDescriptors: [NSSortDescriptor] { get set }
```

## Discussion

This property contains an array of <doc://com.apple.documentation/documentation/Foundation/NSSortDescriptor> objects. A table column is considered sortable if it has a sort descriptor that specifies the sorting direction, a key to sort by, and a selector defining how to sort. Changing the value of this property may have the side effect of calling the [`tableView(_:sortDescriptorsDidChange:)`](/documentation/AppKit/NSTableViewDataSource/tableView(_:sortDescriptorsDidChange:)) method on the table view’s data source.

The contents of this property are archived and persisted along with other column information if autosave is enabled for the table.

---

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)