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

# setCachedSeparately:

Sets whether each image representation uses a separate offscreen window to cache its contents.

```
- (void) setCachedSeparately:(BOOL) flag;
```

## Parameters

`flag`

<doc://com.apple.documentation/documentation/Swift/true> if you want each of the receiver’s image representation objects to use a separate offscreen window for caching; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

If you specify <doc://com.apple.documentation/documentation/Swift/false>, a representation can be cached together with other images, though in practice it might not be. This method does not invalidate any existing caches.

If you plan to resize an `NSImage` object frequently, it is usually more efficient to cache its representations separately. In some situations, you might also want to enable separate caching if you plan to use the [`compositeToPoint:fromRect:operation:`](/documentation/AppKit/NSImage/compositeToPoint:fromRect:operation:) or [`compositeToPoint:fromRect:operation:fraction:`](/documentation/AppKit/NSImage/compositeToPoint:fromRect:operation:fraction:)methods to draw the image.

## See Also

[`func recache()`](/documentation/AppKit/NSImage/recache())

Invalidates and frees offscreen caches of all image representations.



---

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)