<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSOutlineView/autosaveExpandedItems",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSOutlineView(py)autosaveExpandedItems"
  },
  "title" : "autosaveExpandedItems"
}
-->

# autosaveExpandedItems

A Boolean value indicating whether the expanded items are automatically saved across launches of the app.

```
var autosaveExpandedItems: Bool { get set }
```

## Discussion

When the value of this property is <doc://com.apple.documentation/documentation/Swift/true>, the outline view saves the state of its expanded items and restores that state the next time the user launches the app. (If the outline view’s [`autosaveName`](/documentation/AppKit/NSTableView/autosaveName-swift.property) property is `nil`, or if you have not implemented the [`outlineView(_:itemForPersistentObject:)`](/documentation/AppKit/NSOutlineViewDataSource/outlineView(_:itemForPersistentObject:)) and [`outlineView(_:persistentObjectForItem:)`](/documentation/AppKit/NSOutlineViewDataSource/outlineView(_:persistentObjectForItem:)) delegate methods, this setting is ignored and outline information is not saved.) The configuration data is saved separately for each user and for each app. The default value of this property is <doc://com.apple.documentation/documentation/Swift/false>.

You can have separate settings for the [`autosaveExpandedItems`](/documentation/AppKit/NSOutlineView/autosaveExpandedItems) and [`autosaveTableColumns`](/documentation/AppKit/NSTableView/autosaveTableColumns) properties, so you could, for example, save expanded item information, but not table column positions.

## See Also

[`autosaveTableColumns`](/documentation/AppKit/NSTableView/autosaveTableColumns)

A Boolean value indicating whether the order and width of the table view’s columns are automatically saved.

[`autosaveName`](/documentation/AppKit/NSTableView/autosaveName-swift.property)

The name under which table information is automatically saved.



---

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)