dataWithContentsOfFile:options:error:
Creates a data object by reading every byte from the file at a given path.
Declaration
+ (instancetype) dataWithContentsOfFile:(NSString *) path options:(NSDataReadingOptions) readOptionsMask error:(NSError **) errorPtr;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.
- errorPtr:
If an error occurs, upon return contains an error object that describes the problem.
Discussion
This method returns nil if the data object could not be created. In this case, errorPtr will contain an NSError indicating the problem.