Instance Method

beginSheet:completionHandler:

Starts a document-modal session and presents—or queues for presentation—a sheet.

Declaration

- (void)beginSheet:(NSWindow *)sheetWindow completionHandler:(void (^)(NSModalResponse returnCode))handler;

Parameters

sheetWindow

The window object that represents the sheet to present.

handler

The completion handler that gets called when the sheet’s modal session ends.

Discussion

If the window already has a presented sheet, this method queues the specified sheet for presentation after the current sheet is dismissed and then returns control to the caller.

If the window has no presented sheets, this method displays the specified sheet, makes it key, and returns control to the caller. While the sheet remains visible, most events targeted at the receiver are prohibited. The runloop does not enter any special mode to accomplish this.

See Also

Managing Sheets

attachedSheet

The sheet attached to the window.

sheet

A Boolean value that indicates whether the window has ever run as a modal sheet.

- beginCriticalSheet:completionHandler:

Starts a document-modal session and presents the specified critical sheet.

- endSheet:

Ends a document-modal session and dismisses the specified sheet.

- endSheet:returnCode:

Ends a document-modal session and dismisses the specified sheet.

sheetParent

The window to which the sheet is attached.

sheets

An array of the sheets currently attached to the window.