O'Reilly logo

Cocoa Programming for OS X: The Big Nerd Ranch Guide by Aaron Hillegass, Adam Preble, Nate Chandler

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

Modals and Sheets

So far, you have seen APIs for using NSAlert to show a panel modally. When runModal() is called, it blocks until the user dismisses the alert. While the modal alert is being shown it is the only window receiving events; all other windows in the application will be unusable. As a result, when a panel is run modally, users will not be able to use the rest of the application until they have responded to the alert panel. Modal alerts are convenient to show but should be used sparingly for this reason.

Alerts can also be run as a sheet on top of another window (shown in Figure 15.5). This indicates to the user that the alert (or content of the sheet) is related to that window. Similar to running an alert panel modally, ...

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