Instance Method

contentsAtPath:

Returns the contents of the file at the specified path.

Declaration

- (NSData *)contentsAtPath:(NSString *)path;

Parameters

path

The path of the file whose contents you want.

Return Value

An NSData object with the contents of the file. If path specifies a directory, or if some other error occurs, this method returns nil.

See Also

Getting and Comparing File Contents

- contentsEqualAtPath:andPath:

Returns a Boolean value that indicates whether the files or directories in specified paths have the same contents.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software