Initializes a data object with the content of the file at a given path.
SDKs
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
- (instancetype)initWithContentsOfFile:(NSString *)path;
Parameters
path
The absolute path of the file from which to read data.
Return Value
A data object initialized by reading into it the data from the file specified by path
.
Discussion
This method is equivalent to init
with no options.