<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreAI",
  "identifier" : "/documentation/CoreAI/AIModelCache/deleteEntry(referencedBy:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Core AI",
      "CoreAI"
    ],
    "preciseIdentifier" : "s:15CoreAIDelegates12AIModelCacheC11deleteEntry12referencedByy10Foundation4DataV_tKFZ"
  },
  "title" : "deleteEntry(referencedBy:)"
}
-->

# deleteEntry(referencedBy:)

Deletes a cache entry referenced by bookmark data.

```
static func deleteEntry(referencedBy bookmark: Data) throws
```

## Parameters

`bookmark`

Data previously obtained from `AIModel.bookmarkData`.

## Discussion

Use this method to delete a cache entry referenced by bookmark data previously
obtained from `AIModel.bookmarkData`. Because bookmark data encodes both the
specific cache instance and the entry within it, this method is static and requires no
cache instance to call.

> Note: If no ``doc://com.apple.coreai/documentation/CoreAI/AIModel`` instance currently references the entry, deletion happens
> immediately. Otherwise, an error is thrown. Deletion can only occur for an entry when the last ``doc://com.apple.coreai/documentation/CoreAI/AIModel`` releases it.

---

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)