Instance Method


Returns, for a specified URL, the document type identifier to use when opening the document at that location, if successful.


- (NSString *)typeForContentsOfURL:(NSURL *)url error:(NSError * _Nullable *)outError;



The URL to use for locating the type identifier.


An error returned if the type identifer could not be determined; otherwise, nil.


The URL is represented by url. If not successful, the method returns nil after setting outError to point to an NSError object that encapsulates the reason why the document type could not be determined, or the fact that the document type is unrecognized.

You can override this method to customize type determination for documents being opened.

See Also

Managing Document Types


An array of strings representing the custom document classes supported by this app.


Returns the name of the document type that should be used when creating new documents.

- documentClassForType:

Returns the NSDocument subclass associated with a given document type.

- displayNameForType:

Returns the descriptive name for the specified document type, which is used in the File Format pop-up menu of the Save As dialog.