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
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






Cocoa mail archive

