Instance Method

readFromURL:ofType:error:

Sets the contents of the receiver by reading from a file of a given type located by a given URL.

Declaration

- (BOOL)readFromURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError * _Nullable *)error;

Parameters

absoluteURL

An URL that specifies the location from which to read the document.

typeName

The document type at absoluteURL.

outError

If absoluteURL is not valid, or the store at absoluteURL cannot be read, upon return contains an NSError object that describes the problem

Return Value

YES if absoluteURL is valid and the file is read correctly, otherwise NO.

Discussion

This method sets the URL for the persistent object store associated with the receiver’s managed object context to absoluteURL.

See Also

Document Content Management

- revertToContentsOfURL:ofType:error:

Overridden to clean up the managed object context and controllers during a revert.

- writeToURL:ofType:forSaveOperation:originalContentsURL:error:

Saves changes in the document’s managed object context and saves the document’s persistent store to a given URL.