---
title: "parent(forItem:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsoutlineview/parent(foritem:)"
---

# parent(forItem:)

Returns the parent for a given item.

## Declaration

```swift
func parent(forItem item: Any?) -> Any?
```

## Parameters

- `item`: The item for which to return the parent.

## Return Value

Return Value The parent for item, or nil if the parent is the root.

## See Also

### Getting Related Items

- [childIndex(forItem:)](appkit/nsoutlineview/childindex(foritem:).md)
- [child(_:ofItem:)](appkit/nsoutlineview/child(_:ofitem:).md)
- [numberOfChildren(ofItem:)](appkit/nsoutlineview/numberofchildren(ofitem:).md)
