O'Reilly logo

Cocoa® Programming for Mac® OS X, Fourth Edition by Aaron Hillegass, Adam Preble

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 25. Sheets

A sheet is simply an NSWindow instance that is attached to another window. The sheet comes down over the window, and the window stops getting events until the sheet is dismissed. Typically, you will compose a sheet as an off-screen window in your XIB file.

NSApplication has several methods that make sheets possible:

// Start a sheet- (void)beginSheet:(NSWindow *)sheet    modalForWindow:(NSWindow *)docWindow     modalDelegate:(id)modalDelegate    didEndSelector:(SEL)didEndSelector       contextInfo:(void *)contextInfo;// End the sheet- (void)endSheet:(NSWindow *)sheet returnCode:(NSInteger)returnCode;

Besides the sheet window and the window to which it is attached, you supply a modal delegate, a selector, and a contextInfo

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required