getUserVisibleURL(for:completionHandler:)
Returns the user-visible URL for an item.
Declaration
func getUserVisibleURL(for itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping @Sendable (URL?, (any Error)?) -> Void)func getUserVisibleURL(for itemIdentifier: NSFileProviderItemIdentifier) async throws -> URLParameters
- itemIdentifier:
The item’s identifier.
- completionHandler:
A block that the system calls after determining the item’s URL. The system passes the following parameters:
userVisibleFileThe URL of the user visible file, or
nilif an error occurs.errorIf an error occurs, this object contains information about the error; otherwise, it’s
nil.
Discussion
Calling this method marks the process so that accessing the URL won’t materialize the item. Instead, any attempt to read or write to an unmaterialized item fails with a EDEADLK POSIX error.