Instance Method

runModalOpenPanel:forTypes:

Presents a modal Open dialog and limits selection to specific file types.

Declaration

- (NSInteger)runModalOpenPanel:(NSOpenPanel *)openPanel forTypes:(NSArray<NSString *> *)types;

Parameters

openPanel

The open panel to display.

types

An array of allowable types to open.

Discussion

This method is called by the URLsFromRunningOpenPanel method. It calls the NSOpenPanel runModalForTypes: method, passing the openPanel object and the file extensions associated with a document type. The extensions parameter may also contain encoded HFS file types as well as filename extensions.

See Also

Managing the Open Dialog

- beginOpenPanelWithCompletionHandler:

Presents an Open dialog and delivers the results to a completion handler as an array of URLs for the chosen files (or nil).

- beginOpenPanel:forTypes:completionHandler:

Presents a nonmodal Open dialog that displays files that can be opened based on a list of UTIs.

currentDirectory

The directory path to be used as the starting point in the Open panel.

- URLsFromRunningOpenPanel

An array of URLs corresponding to the files selected in a running open panel.