Initializer

init(contentsOf:options:)

Returns a data object initialized with the data from the location specified by a given URL.

Declaration

init(contentsOf url: URL, options readOptionsMask: NSData.ReadingOptions = []) throws

Parameters

aURL

The URL from which to read data.

mask

A mask that specifies options for reading the data. Constant components are described in NSData.ReadingOptions.

errorPtr

If there is an error reading in the data, upon return contains an NSError object that describes the problem.

Return Value

A data object initialized with the data from the location specified by aURL. The returned object might be different than the original receiver.

Discussion

See Also

Related Symbols

dataWithContentsOfURL:options:error:

Creates and returns a data object containing the data from the location specified by aURL.