Instance Method


Tells the delegate to open a single file.


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



The application object associated with the delegate.


The name of the file to open.

Return Value

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


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.