Skip navigation.
 
mlRe: Alert Sheets hard wired in Interface Builder
FROM : Jens Alfke
DATE : Sun Jun 01 21:07:20 2008

On 1 Jun '08, at 11:19 AM, John Love wrote:

> the NSAlert is
> type-cast as a NSWindow when passed to my dlgEndSelector, so that
> "unrecognized selector" is mystifying.


That's your problem, then: NSAlert isn't an NSWindow; it's a direct 
subclass of NSObject. Your -endCalculateSheet: method's first 
parameter should be (NSAlert*), not (NSWindow*). NSAlert.h says:

// ... The didEndSelector should have the following signature:
//- (void)alertDidEnd:(NSAlert *)alert returnCode:
(NSInteger)returnCode contextInfo:(void *)contextInfo;

This is a bit inconsistent of them since other "didEnd" methods take 
the sheet's NSPanel* as their first argument. I think they did it 
because there's no obvious way to take an NSPanel* and find the 
NSAlert that owns it.

—Jens

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