Instance Method

readFromFileWrapper:ofType:error:

Sets the contents of this document by reading from a file wrapper of a specified type.

Declaration

- (BOOL)readFromFileWrapper:(NSFileWrapper *)fileWrapper ofType:(NSString *)typeName error:(NSError * _Nullable *)outError;

Parameters

fileWrapper

The file wrapper from which the document contents are read.

typeName

The string that identifies the document type.

outError

On return, if the document contents could not be read, a pointer to an error object that encapsulates the reason they could not be read.

Return Value

YES if the document contents could be read; otherwise, NO.

Discussion

The default implementation of this method invokes [self readFromData:[fileWrapper regularFileContents] ofType:typeName error:outError].

For backward binary compatibility with OS X v10.3 and earlier, the default implementation of this method instead invokes [self loadFileWrapperRepresentation:fileWrapper ofType:typeName] if loadFileWrapperRepresentation:ofType: is overridden.

See Also

Reading From and Writing to Files

fileModificationDate

The last known modification date of the document’s on-disk representation.

- runModalSavePanelForSaveOperation:delegate:didSaveSelector:contextInfo:

Presents a modal Save panel to the user, then tries to save the document if the user approves the panel.

shouldRunSavePanelWithAccessoryView

A Boolean value indicating whether the document’s Save panel displays a list of supported writable document types.

keepBackupFile

A Boolean value indicating whether the document keeps the backup files created before the document data is written to a file.

backupFileURL

The URL for the document’s backup file that was created during an autosave operation.

fileURL

The location of the document’s on-disk representation.

draft

A Boolean value indicating whether the document is a draft that the user has not expressed an interest in keeping around.