Re: Alert Sheets hard wired in Interface Builder
Re: Alert Sheets hard wired in Interface Builder
- Subject: Re: Alert Sheets hard wired in Interface Builder
- From: Jens Alfke <email@hidden>
- Date: Sun, 1 Jun 2008 12:07:20 -0700
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
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden