Instance Method


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


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



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


The document type at absoluteURL.


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.


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.