---
title: "checkPromisedItemIsReachableAndReturnError(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsurl/checkpromiseditemisreachableandreturnerror(_:)"
---

# checkPromisedItemIsReachableAndReturnError(_:)

Returns whether the promised item can be reached.

## Declaration

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

## Parameters

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

## Return Value

Return Value true if the promised item is reachable; otherwise, false.

## Discussion

Discussion This method behaves identically to 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 or 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, forDeleting, forMoving, or contentIndependentMetadataOnly options You must use this method instead of checkResourceIsReachableAndReturnError for any URLs returned by these methods.

## See Also

### Related Documentation

- [checkResourceIsReachableAndReturnError(_:)](foundation/nsurl/checkresourceisreachableandreturnerror(_:).md)

### Working with Promised Items

- [getPromisedItemResourceValue(_:forKey:)](foundation/nsurl/getpromiseditemresourcevalue(_:forkey:).md)
- [promisedItemResourceValues(forKeys:)](foundation/nsurl/promiseditemresourcevalues(forkeys:).md)
