Contents

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 -> URL

Parameters

  • itemIdentifier:

    The item’s identifier.

  • completionHandler:

    A block that the system calls after determining the item’s URL. The system passes the following parameters:

    userVisibleFile

    The URL of the user visible file, or nil if an error occurs.

    error

    If 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.

See Also

Translating user-visible URLs