Post · 1 min read· p. 126

Technote. Item identity in NSOutlineView

If an NSOutlineView is managed by a NSTreeController, expansion state is only maintained on reloads when the items (NSTreeNode.representedObject) maintain persistent object identity.

This suggests that a controller which is preparing the content for the tree controller ought to maintain a cache keyed by persistent IDs that uniquely identify an item within the outline view.