<!--
{
  "availability" : [
    "macOS: 10.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSDocument/restorableStateKeyPaths",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSDocument(cpy)restorableStateKeyPaths"
  },
  "title" : "restorableStateKeyPaths"
}
-->

# restorableStateKeyPaths

Returns an array of key paths that represent the restorable attributes of the document.

```
class var restorableStateKeyPaths: [String] { get }
```

## Return Value

An array of <doc://com.apple.documentation/documentation/Foundation/NSString> objects, each of which contains a key path to one of the document’s attributes.

## Discussion

You can use this method instead of, or in addition to, the [`encodeRestorableState(with:)`](/documentation/AppKit/NSDocument/encodeRestorableState(with:)) and [`restoreState(with:)`](/documentation/AppKit/NSDocument/restoreState(with:)) methods to save and restore the state of your document. The key paths must refer to attributes that are [Key-value coding](https://developer.apple.com/library/archive/documentation/General/Conceptual/DevPedia-CocoaCore/KeyValueCoding.html#//apple_ref/doc/uid/TP40008195-CH25) and [Key-value observing](https://developer.apple.com/library/archive/documentation/General/Conceptual/DevPedia-CocoaCore/KVO.html#//apple_ref/doc/uid/TP40008195-CH16) compliant.

When changes are detected, the specified attributes are automatically written to disk with the rest of the app’s interface-related state. At launch time, the attributes are automatically restored to their previous values.

---

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)