Contents

init(contentsOf:options:)

Creates a data object from the data at the provided file URL using specific reading options.

Declaration

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

Parameters

  • url:

    The location on disk of the data to read.

  • readOptionsMask:

    The mask specifying the options to use when reading the data. For more information, see Readingoptions.

Discussion

If the system can’t create an instance, the initializer may throw in Swift, or return nil in Objective-C.