<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSURL/checkPromisedItemIsReachableAndReturnError(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSURL(im)checkPromisedItemIsReachableAndReturnError:"
  },
  "title" : "checkPromisedItemIsReachableAndReturnError(_:)"
}
-->

# checkPromisedItemIsReachableAndReturnError(_:)

Returns whether the promised item can be reached.

```
func checkPromisedItemIsReachableAndReturnError(_ error: NSErrorPointer) -> Bool
```

## Parameters

`error`

The error that occurred when the promised item could not be reached.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the promised item is reachable; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

This method behaves identically to [`checkResourceIsReachableAndReturnError(_:)`](/documentation/Foundation/NSURL/checkResourceIsReachableAndReturnError(_:)), but works on promised items. A promised item is not guaranteed to have its contents in the file system until you use a file coordinator to perform a coordinated read on its URL, which causes the contents to be downloaded or otherwise generated. Promised item URLs are returned by various APIs, including:

- A metadata query using either the [`NSMetadataQueryUbiquitousDataScope`](/documentation/Foundation/NSMetadataQueryUbiquitousDataScope) or [`NSMetadataQueryUbiquitousDocumentsScope`](/documentation/Foundation/NSMetadataQueryUbiquitousDocumentsScope) scopes
- The contents of the directory returned by the file manager’s `URLForUbiquitousContainerIdentifier:`
- The URL inside the accessor block of a coordinated read or write operation that used the [`immediatelyAvailableMetadataOnly`](/documentation/Foundation/NSFileCoordinator/ReadingOptions/immediatelyAvailableMetadataOnly), [`forDeleting`](/documentation/Foundation/NSFileCoordinator/WritingOptions/forDeleting), [`forMoving`](/documentation/Foundation/NSFileCoordinator/WritingOptions/forMoving), or [`contentIndependentMetadataOnly`](/documentation/Foundation/NSFileCoordinator/WritingOptions/contentIndependentMetadataOnly) options

You must use this method instead of `checkResourceIsReachableAndReturnError` for any URLs returned by these methods.

## See Also

[`checkResourceIsReachableAndReturnError(_:)`](/documentation/Foundation/NSURL/checkResourceIsReachableAndReturnError(_:))

Returns whether the resource pointed to by a file URL can be reached.



---

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)