---
title: countKeyPath
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nstreecontroller/countkeypath
---

# countKeyPath

The key path used to find the number of children for a node.

## Declaration

```swift
var countKeyPath: String? { get set }
```

## Discussion

Discussion Specifying this key path (if the data is available in the model object) can increase performance, but disables insert and remove functionality.

## See Also

### Specifying model attributes

- [childrenKeyPath](appkit/nstreecontroller/childrenkeypath.md)
- [childrenKeyPath(for:)](appkit/nstreecontroller/childrenkeypath(for:).md)
- [countKeyPath(for:)](appkit/nstreecontroller/countkeypath(for:).md)
- [leafKeyPath](appkit/nstreecontroller/leafkeypath.md)
- [leafKeyPath(for:)](appkit/nstreecontroller/leafkeypath(for:).md)
