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

# child(_:ofItem:)

Returns the specified child of an item.

```
func child(_ index: Int, ofItem item: Any?) -> Any?
```

## Parameters

`index`

The index of the child item in the parent.

`item`

The parent item whose child item you want to retrieve.

## Return Value

The child item or `nil` if the item could not be found.

## 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(_:child:ofItem:)`](/documentation/AppKit/NSOutlineViewDataSource/outlineView(_:child:ofItem:)) 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)