Skip navigation.
 
mlRe: Alert Sheets hard wired in Interface Builder
FROM : Chris Hanson
DATE : Thu May 29 07:44:25 2008

On May 27, 2008, at 9:06 PM, Jens Alfke wrote:

> On 27 May '08, at 1:40 PM, Kyle Sluder wrote:
>

>> You're looking for +[NSApplication
>> beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:],

>
> I'm not surprised the OP didn't find this … it's my candidate for 
> Most Misplaced Cocoa Method.


I suspect the general sheet methods (which are instance methods, not 
class methods) are on NSApplication for largely historical reasons. 
If you look at <AppKit/NSApplication.h>, you'll see that NSApplication 
has a couple of instance methods dealing with running a modal session 
"relative to" a window:

- (NSInteger)runModalForWindow:(NSWindow *)theWindow relativeToWindow:
(NSWindow *)docWindow;
- (NSModalSession)beginModalSessionForWindow:(NSWindow *)theWindow 
relativeToWindow:(NSWindow *)docWindow;

These are effectively the OpenStep predecessor to sheets.  They're 
preceded by comments indicating that they're deprecated, but are not 
formally tagged as such in the headers.

There are also similar -- and similarly-deprecated -- functions in 
<AppKit/NSPanel.h> for running alert panels relative to a window.

In both cases, sheets are called out as the replacement technology, 
and the replacements are defined practically right next to the 
deprecated functionality.

  -- Chris

Related mailsAuthorDate
mlAlert Sheets hard wired in Interface Builder John Love May 27, 22:28
mlRe: Alert Sheets hard wired in Interface Builder Sherman Pendley May 27, 22:38
mlRe: Alert Sheets hard wired in Interface Builder Kyle Sluder May 27, 22:40
mlRe: Alert Sheets hard wired in Interface Builder Jens Alfke May 28, 06:06
mlRe: Alert Sheets hard wired in Interface Builder Graham Cox May 28, 06:24
mlRe: Alert Sheets hard wired in Interface Builder Scott Ribe May 29, 05:29
mlRe: Alert Sheets hard wired in Interface Builder Kyle Sluder May 29, 05:38
mlRe: Alert Sheets hard wired in Interface Builder Jens Alfke May 29, 05:39
mlRe: Alert Sheets hard wired in Interface Builder Graham Cox May 29, 05:58
mlRe: Alert Sheets hard wired in Interface Builder Chris Hanson May 29, 07:44
mlRe: Alert Sheets hard wired in Interface Builder John Love May 31, 17:43
mlRe: Alert Sheets hard wired in Interface Builder John Love May 31, 18:40
mlRe: Alert Sheets hard wired in Interface Builder Keary Suska May 31, 19:08
mlRe: Alert Sheets hard wired in Interface Builder Jens Alfke May 31, 19:22
mlRe: Alert Sheets hard wired in Interface Builder John Love Jun 1, 20:19
mlRe: Alert Sheets hard wired in Interface Builder Jens Alfke Jun 1, 21:07
mlRe: Alert Sheets hard wired in Interface Builder Nathan Kinsinger Jun 1, 21:15
mlRe: Alert Sheets hard wired in Interface Builder John Love Jun 3, 22:27