Creates a data object by reading every byte from the file at a given path.
- iOS 2.0+
- macOS 10.0+
- UIKit for Mac 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
The absolute path of the file from which to read data.
This method returns
nil if the data object could not be created. If you need to know the reason for failure, use
This method is equivalent to calling
data and passing no options.
A sample using this method can be found in Working With Binary Data.