Instance Method

application:openFile:

Tells the delegate to open a single file.

Declaration

- (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename;

Parameters

theApplication

The application object associated with the delegate.

filename

The name of the file to open.

Return Value

YES if the file was successfully opened or NO if it was not.

Discussion

Sent directly by theApplication to the delegate. The method should open the file filename, returning YES if the file is successfully opened, and NO otherwise. If the user started up the application by double-clicking a file, the delegate receives the application:openFile: message before receiving applicationDidFinishLaunching:. (applicationWillFinishLaunching: is sent before application:openFile:.)

See Also

Opening Files

- application:openFileWithoutUI:

Tells the delegate to open a file programmatically.

- application:openTempFile:

Tells the delegate to open a temporary file.

- application:openFiles:

Tells the delegate to open multiple files.

- applicationOpenUntitledFile:

Tells the delegate to open an untitled file.

- applicationShouldOpenUntitledFile:

Invoked immediately before opening an untitled file.