Instance Method

revertToContentsOfURL:ofType:error:

Discards all unsaved document modifications and replaces the document’s contents by reading a file or file package located by a URL of a specified type.

Declaration

- (BOOL)revertToContentsOfURL:(NSURL *)url ofType:(NSString *)typeName error:(NSError * _Nullable *)outError;

Parameters

absoluteURL

The location from which the document contents are read.

typeName

The string that identifies the document type.

outError

On return, if the document could not be reverted, a pointer to an error object that encapsulates the reason it could not be reverted.

Return Value

YES if the document could be reverted; otherwise, NO.

Discussion