Class

NSOpenPanel

A panel that prompts the user to select a file to open.

Declaration

@interface NSOpenPanel : NSSavePanel

Overview

Apps use the Open panel as a convenient way to query the user for the name of a file to open. In macOS 10.15 and later, the system always draws Open panels in a separate process, regardless of whether the app is sandboxed. When the user chooses a file to open, macOS adds that file to the app’s sandbox. Prior to macOS 10.15, the system drew the panels in a separate process only for sandboxed apps.

Topics

Creating an Open Panel

+ openPanel

Creates a new Open panel and initializes it with a default configuration.

Configuring the Open Panel

canChooseFiles

A Boolean that indicates whether the user can choose files in the panel.

canChooseDirectories

A Boolean that indicates whether the user can choose directories in the panel.

resolvesAliases

A Boolean that indicates whether the panel resolves aliases.

allowsMultipleSelection

A Boolean that indicates whether the user may select multiple files and directories.

accessoryViewDisclosed

A Boolean value that indicates whether the panel's accessory view is visible.

Accessing User Selection

URLs

An array of URLs, each of which contains the fully specified location of a selected file or directory.

Supporting iCloud Documents

canDownloadUbiquitousContents

A Boolean value that indicates how the panel responds to iCloud documents that aren't fully downloaded locally.

canResolveUbiquitousConflicts

A Boolean value that indicates how the panel responds to iCloud documents that have conflicting versions.

Deprecated

Avoid using deprecated classes and protocols in your apps.

Deprecated Symbols

Review symbols that are no longer supported, and find the replacements to use instead.

Relationships

Inherits From

See Also

Open and Save Panels

NSSavePanel

A panel that prompts the user for information about where to save a file.

NSOpenSavePanelDelegate

A set of methods for managing interactions with an open or save panel.