---
title: invalidateRestorableState()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nsdocument/invalidaterestorablestate()
---

# invalidateRestorableState()

Marks the document’s interface-related state as dirty.

## Declaration

```swift
func invalidateRestorableState()
```

## Discussion

Discussion Call this method whenever the restorable state of your document changes. This method marks the document’s state as dirty, which causes that state to be written to disk at some point in the future. Do not override this method.

## See Also

### Handling Window Restoration

- [allowedClasses(forRestorableStateKeyPath:)](appkit/nsdocument/allowedclasses(forrestorablestatekeypath:).md)
- [encodeRestorableState(with:)](appkit/nsdocument/encoderestorablestate(with:).md)
- [restoreState(with:)](appkit/nsdocument/restorestate(with:).md)
- [restorableStateKeyPaths](appkit/nsdocument/restorablestatekeypaths.md)
- [restoreWindow(withIdentifier:state:completionHandler:)](appkit/nsdocument/restorewindow(withidentifier:state:completionhandler:).md)
