---
title: NSTreeNode
framework: appkit
role: symbol
role_heading: Class
path: appkit/nstreenode
---

# NSTreeNode

A node in a tree of nodes.

## Declaration

```swift
class NSTreeNode
```

## Overview

Overview NSTreeNode simplifies the creation and management of trees of objects. Each tree node represents a model object. A tree node with nil as its parent node is considered the root of the tree.

## Topics

### Creating tree nodes

- [init(representedObject:)](appkit/nstreenode/init(representedobject:).md)

### Getting information about a node

- [representedObject](appkit/nstreenode/representedobject.md)
- [indexPath](appkit/nstreenode/indexpath.md)
- [isLeaf](appkit/nstreenode/isleaf.md)
- [children](appkit/nstreenode/children.md)
- [mutableChildren](appkit/nstreenode/mutablechildren.md)
- [descendant(at:)](appkit/nstreenode/descendant(at:).md)
- [parent](appkit/nstreenode/parent.md)

### Sorting the subtree

- [sort(with:recursively:)](appkit/nstreenode/sort(with:recursively:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Tree-Based Data

- [Navigating Hierarchical Data Using Outline and Split Views](appkit/navigating-hierarchical-data-using-outline-and-split-views.md)
- [NSTreeController](appkit/nstreecontroller.md)
