<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FileProvider",
  "identifier" : "/documentation/FileProvider/NSFileProviderError/Code/deletionRejected",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "File Provider"
    ],
    "preciseIdentifier" : "c:@E@NSFileProviderErrorCode@NSFileProviderErrorDeletionRejected"
  },
  "title" : "NSFileProviderError.Code.deletionRejected"
}
-->

# NSFileProviderError.Code.deletionRejected

An error indicating a failed deletion action.

```
case deletionRejected
```

## Discussion

If the user tries to delete an item, but your extension needs to reject the deletion (for example, due to a conflicting remote change), return an [`NSFileProviderError.Code.deletionRejected`](/documentation/FileProvider/NSFileProviderError/Code/deletionRejected) error. The system recreates the deleted item based on the latest metadata available from your extension.

Call the <doc://com.apple.documentation/documentation/Foundation/NSError/fileProviderErrorForRejectedDeletion(of:)> method to create the error object.

---

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)