<!--
{
  "availability" : [
    "macOS: 10.0.0 - 10.13.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSWindow/restoreCachedImage()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSWindow(im)restoreCachedImage"
  },
  "title" : "restoreCachedImage()"
}
-->

# restoreCachedImage()

Splices the window’s cached image rectangles, if any, back into its raster image (and buffer if it has one), undoing the effect of any drawing performed within those areas since they were established using [`cacheImage(in:)`](/documentation/AppKit/NSWindow/cacheImage(in:)).

```
func restoreCachedImage()
```

## Discussion

You must invoke [`flush()`](/documentation/AppKit/NSWindow/flush()) after this method to guarantee proper redisplay. An `NSWindow` object automatically discards its cached image rectangles when it displays.

## See Also

[`display()`](/documentation/AppKit/NSWindow/display())

Passes a display message down the window’s view hierarchy, thus redrawing all views within the window.



---

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)