outlineView(_:child:ofItem:)
Returns the child item at the specified index of a given item.
Declaration
@MainActor optional func outlineView(_ outlineView: NSOutlineView, child index: Int, ofItem item: Any?) -> AnyParameters
- outlineView:
The outline view that sent the message.
- index:
The index of the child item from
itemto return. - item:
An item in the data source.
Return Value
The child item at index of item. If item is nil, returns the appropriate child item of the root object.
Discussion
Children of a given parent item are accessed sequentially. In order for the collapsed state of the outline view to remain consistent when it is reloaded you must always return the same object for a specified child and item.
Special Considerations
The outlineView(_:child:ofItem:) method is called very frequently, so it must be efficient.
See Also
Related Documentation
Instance Methods
outlineView(_:acceptDrop:item:childIndex:)outlineView(_:draggingSession:endedAt:operation:)outlineView(_:draggingSession:willBeginAt:forItems:)outlineView(_:isItemExpandable:)outlineView(_:itemForPersistentObject:)outlineView(_:namesOfPromisedFilesDroppedAtDestination:forDraggedItems:)outlineView(_:numberOfChildrenOfItem:)outlineView(_:objectValueFor:byItem:)outlineView(_:pasteboardWriterForItem:)outlineView(_:persistentObjectForItem:)outlineView(_:setObjectValue:for:byItem:)outlineView(_:sortDescriptorsDidChange:)outlineView(_:updateDraggingItemsForDrag:)outlineView(_:validateDrop:proposedItem:proposedChildIndex:)outlineView(_:writeItems:to:)