<!--
{
  "availability" : [
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSOutlineView/numberOfChildren(ofItem:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSOutlineView(im)numberOfChildrenOfItem:"
  },
  "title" : "numberOfChildren(ofItem:)"
}
-->

# numberOfChildren(ofItem:)

Returns the number of children for the specified parent item.

```
func numberOfChildren(ofItem item: Any?) -> Int
```

## Parameters

`item`

The parent item.

## Return Value

The number of children associated with the parent.

## Discussion

You can call this method on an outline view with either a static or dynamic data source. For an outline view whose contents are dynamic, this method may call out to the [`outlineView(_:numberOfChildrenOfItem:)`](/documentation/AppKit/NSOutlineViewDataSource/outlineView(_:numberOfChildrenOfItem:)) method of the associated data source object.

---

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)