Instance Method


Gives the delegate the opportunity to validate selected items.


- (BOOL)panel:(id)sender isValidFilename:(NSString *)filename;



Panel requesting filename validation.


String representing the filename to validate.

Return Value

YES if the filename is valid, or NO if the save panel should stay in its modal loop and wait for the user to type in or select a different filename or names.


The NSSavePanel object sender sends this message just before the end of a modal session for each filename displayed or selected (including filenames in multiple selections). If the delegate refuses a filename in a multiple selection, none of the filenames in the selection is accepted.

See Also

Running Panels

- beginSheetForDirectory:file:modalForWindow:modalDelegate:didEndSelector:contextInfo:

Presents a Save panel as a sheet with a specified path and, optionally, a specified file in that path.

- beginSheetModalForWindow:completionHandler:

Presents the panel as a sheet modal to the specified window.

- beginWithCompletionHandler:

Presents the panel as a modeless window.

- runModal

Displays the panel and begins its event loop with the current working (or last selected) directory as the default starting point.

- runModalForDirectory:file:

Initializes the panel to the directory and file specified, if any, then displays it and begins its modal event loop.

- panel:compareFilename:with:caseSensitive:

Controls the ordering of files presented by the NSSavePanel object specified.

- validateVisibleColumns

Validates and possibly reloads the browser columns visible in the panel by invoking the delegate method panel:shouldShowFilename:.

- panel:shouldShowFilename:

Gives the delegate the opportunity to filter items that it doesn’t want the user to choose.

- panel:directoryDidChange:

Tells the delegate that the user has changed the selected directory in the NSSavePanel object specified.