Contents

readFromFile:ofType:

Reads and loads document data of the given type from the given file.

Declaration

- (BOOL) readFromFile:(NSString *) fileName ofType:(NSString *) type;

Discussion

Reads and loads document data of type docType from the file fileName, returning whether the operation was successful. This method invokes loadDataRepresentation:ofType: and is invoked when the receiver is first created and initialized by initWithContentsOfFile:ofType:. It uses NSData init(contentsOfFile:) to get the document data.

This method is one of the location-based primitives. Subclasses can override this method instead of overriding loadDataRepresentation:ofType: to read and load document data. Subclasses that handle file packages such as RTFD or that treat locations of files as anything other than paths should override this method. Override implementations of this method can filter the document data using NSPasteboard or other filtering services.

See Also

Methods