Initializer

init(resolvingAliasFileAt:options:)

Returns a new URL made by resolving the alias file at url.

Declaration

convenience init(resolvingAliasFileAt url: URL, options: NSURL.BookmarkResolutionOptions = []) throws

Parameters

url

The URL pointing to the alias file.

options

Options taken into account when resolving the bookmark data. The withSecurityScope option is not supported by this method.

error

The error that occurred while trying to resolve the provided URL.

Return Value

A new URL created by resolving the bookmark data derived from the provided alias file. If an error occurs, this method returns nil.

Discussion

Creates and initializes a new URL based on the alias file at url. Use this method to resolve bookmark data that was saved using writeBookmarkData(_:to:options:) and resolves that data in one step.

If the url argument does not refer to an alias file as defined by the NSURLIsAliasFileKey property, this method returns the url argument.

If the url argument is unreachable, this method returns nil and the optional error argument is populated.

See Also

Creating an NSURL Object

init?(string: String)

Initializes an NSURL object with a provided URL string.

init?(string: String, relativeTo: URL?)

Initializes an NSURL object with a base URL and a relative string.

class func fileURL(withPath: String, isDirectory: Bool)

Initializes and returns a newly created NSURL object as a file URL with a specified path.

init(fileURLWithPath: String, isDirectory: Bool)

Initializes a newly created NSURL referencing the local file or directory at path.

class func fileURL(withPath: String)

Initializes and returns a newly created NSURL object as a file URL with a specified path.

init(fileURLWithPath: String)

Initializes a newly created NSURL referencing the local file or directory at path.

class func fileURL(withPathComponents: [String])

Initializes and returns a newly created NSURL object as a file URL with specified path components.

class func fileURL(withFileSystemRepresentation: UnsafePointer<Int8>, isDirectory: Bool, relativeTo: URL?)

Returns a new URL object initialized with a C string representing a local file system path.

func getFileSystemRepresentation(UnsafeMutablePointer<Int8>, maxLength: Int)

Fills the provided buffer with a C string representing a local file system path.

init(fileURLWithFileSystemRepresentation: UnsafePointer<Int8>, isDirectory: Bool, relativeTo: URL?)

Initializes a URL object with a C string representing a local file system path.