Deprecated NSApplication Methods

A method identified as deprecated has been superseded and may become unsupported in the future.

Available in OS X v10.3 through OS X v10.5

application:printFiles:

(Available in OS X v10.3 through OS X v10.5. Use the delegate method application:printFiles:withSettings:showPrintPanels: instead.)

- (void)application:(NSApplication *)sender printFiles:(NSArray *)filenames
Discussion

Identical to application:printFile: except that the receiver prints multiple files corresponding to the file names in the filenames array.

Delegates should invoke the replyToOpenOrPrint: method upon success or failure, or when the user cancels the operation.

Availability
  • Available in OS X v10.3 through OS X v10.5.
Declared In
NSApplication.h

Deprecated in OS X v10.0

beginModalSessionForWindow:relativeToWindow:

(Deprecated in OS X v10.0. Use beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo: instead.)

- (NSModalSession)beginModalSessionForWindow:(NSWindow *)theWindow relativeToWindow:(NSWindow *)docWindow
Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.0.
Declared In
NSApplication.h

runModalForWindow:relativeToWindow:

(Deprecated in OS X v10.0. Use beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo: instead.)

- (NSInteger)runModalForWindow:(NSWindow *)theWindow relativeToWindow:(NSWindow *)docWindow
Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.0.
Declared In
NSApplication.h

Deprecated in OS X v10.9

beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:

Starts a document modal session. (Deprecated in OS X v10.9.)

- (void)beginSheet:(NSWindow *)sheet modalForWindow:(NSWindow *)docWindow modalDelegate:(id)modalDelegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo
Parameters
sheet

The window object representing the sheet you want to display.

docWindow

The window object to which you want to attach the sheet.

modalDelegate

The delegate object that defines your didEndSelector method. If nil, the method in didEndSelector is not called.

didEndSelector

An optional method to call when the sheet’s modal session has ended. This method must be defined on the object in the modalDelegate parameter and have the following signature:

- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;
contextInfo

A pointer to the context info you want passed to the didEndSelector method when the sheet’s modal session ends.

Discussion

This method runs the modal event loop for the specified sheet synchronously. It displays the sheet, makes it key, starts the run loop, and processes events for it. While the application is in the run loop, it does not respond to any other events (including mouse, keyboard, or window-close events) unless they are associated with the sheet. It also does not perform any tasks (such as firing timers) that are not associated with the modal run loop. In other words, this method consumes only enough CPU time to process events and dispatch them to the action methods associated with the modal window.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.9.
Related Sample Code
Declared In
NSApplication.h

endSheet:

Ends a document modal session by specifying the sheet window. (Deprecated in OS X v10.9.)

- (void)endSheet:(NSWindow *)sheet
Parameters
sheet

The sheet whose modal session you want to end.

Discussion

This method ends the modal session with the return code NSModalResponseStop.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.9.
Declared In
NSApplication.h

endSheet:returnCode:

Ends a document modal session by specifying the sheet window. (Deprecated in OS X v10.9.)

- (void)endSheet:(NSWindow *)sheet returnCode:(NSInteger)returnCode
Parameters
sheet

The sheet whose modal session you want to end.

returnCode

The return code to send to the delegate. You can use one of the return codes defined in NSModalResponse or a custom value that you define.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.9.
Related Sample Code
Declared In
NSApplication.h