Instance Method

URLForApplicationToOpenURL:

Returns the URL to the default app that would be opened.

Declaration

- (NSURL *)URLForApplicationToOpenURL:(NSURL *)url;

Parameters

url

The URL of the file to open.

Return Value

The URL of the default app that would open the specified url. Returns nil if no app is able to open the URL, or if the file URL does not exist.

Discussion

This method is the programmatic equivalent of double-clicking a document in the Finder.

You can safely call this method from any thread of your app.

See Also

Requesting Information

- getInfoForFile:application:type:

Retrieves information about the specified file.

- getFileSystemInfoForPath:isRemovable:isWritable:isUnmountable:description:type:

Returns information about the file system at the specified path.

- isFilePackageAtPath:

Determines whether the specified path is a file package.

frontmostApplication

Returns the frontmost app, which is the app that receives key events.

runningApplications

Returns an array of running apps.

menuBarOwningApplication

Returns the app that owns the currently displayed menu bar.