Instance Method

runModalForDirectory:file:

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

Declaration

- (NSInteger)runModalForDirectory:(NSString *)path file:(NSString *)name;

Parameters

path

Directory whose files the panel displays. When nil, the directory is the same directory used in the previous invocation of the panel; this is probably the best choice for most situations.

filename

Specifies a particular file in path that is selected when the Save panel is presented to a user. When nil, no file is initially selected.

Return Value

NSFileHandlingPanelOKButton (if the user clicks the OK button) or NSFileHandlingPanelCancelButton (if the user clicks the Cancel button).

Discussion

This method invokes NSApplication’s runModalForWindow: method with self as the argument.

See Also

Methods

- requiredFileType

Returns the required file type (if any).

Deprecated
- setRequiredFileType:

Specifies the file type (as an extension) or a UTI.

Deprecated
- setDirectory:

Sets the current pathname in the panel’s browser.

Deprecated
- 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.

Deprecated
- panel:compareFilename:with:caseSensitive:

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

Deprecated
- panel:isValidFilename:

Gives the delegate the opportunity to validate selected items.

Deprecated
- panel:shouldShowFilename:

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

Deprecated
- panel:directoryDidChange:

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

Deprecated
- directory

Returns the absolute pathname of the directory currently shown in the panel.

Deprecated
- filename

Returns the absolute pathname of the file currently shown in the panel.

Deprecated
- selectText:

This method has been deprecated.

Deprecated