Instance Method

type:conformsToType:

Returns a Boolean indicating that the first Uniform Type Identifier conforms to the second Uniform Type Identifier.

Declaration

- (BOOL)type:(NSString *)firstTypeName conformsToType:(NSString *)secondTypeName;

Parameters

firstTypeName

A string containing the Uniform Type Identifier that should conform to secondTypeName.

secondTypeName

A string containing a Uniform Type Identifier.

Return Value

YES if firstTypeName conforms to the uniform type identifier hierarchy of secondTypeName, NO otherwise.

Discussion

Use this method instead of comparing Uniform Identifier Types for equality. See Uniform Type Identifiers Overview for information about Uniform Type Identifier conformance.

This method will always return YES if the two strings are equal. It is appropriate to use this method with other type names, including those declared in CFBundleTypeName Info.plist entries.

It is safe to call this method from any thread of your app.

See Also

Manipulating Uniform Type Identifier Information

- typeOfFile:error:

Returns the uniform type identifier of the specified file, if it can be determined..

- localizedDescriptionForType:

Returns the localized description for the specified Uniform Type Identifier

- preferredFilenameExtensionForType:

Returns the preferred filename extension for the specified Uniform Type Identifier.

- filenameExtension:isValidForType:

Returns whether the specified filename extension is appropriate for the Uniform Type Identifier.

- URLForApplicationWithBundleIdentifier:

Returns the URL for the app with the specified identifier.