• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Alert Sheets hard wired in Interface Builder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: Alert Sheets hard wired in Interface Builder (From: "John Love" <email@hidden>)

  • Prev by Date: Re: NSColorWell and alpha
  • Next by Date: Re: Alert Sheets hard wired in Interface Builder
  • Previous by thread: Re: Alert Sheets hard wired in Interface Builder
  • Next by thread: Re: Alert Sheets hard wired in Interface Builder
  • Index(es):
    • Date
    • Thread