Contents

init(contentsOfFile:options:)

Initializes a data object with the content of the file at a given path.

Declaration

init(contentsOfFile path: String, options readOptionsMask: NSData.ReadingOptions = []) throws

Parameters

  • path:

    The absolute path of the file from which to read data.

  • readOptionsMask:

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

Return Value

A data object initialized by reading into it the data from the file specified by path.

Discussion

See Also

Reading Data from a File