• 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
problems with NSBeginAlertSheet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problems with NSBeginAlertSheet


  • Subject: problems with NSBeginAlertSheet
  • From: email@hidden
  • Date: Thu, 17 May 2001 17:44:50 -0500

hello everyone. i am having problems with NSBeginAlertSheet. here's the header for it..

APPKIT_EXTERN void NSBeginAlertSheet(NSString *title, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, NSWindow *docWindow, id modalDelegate, SEL didEndSelector, SEL didDismissSelector, void *contextInfo, NSString *msg, ...);

now, i want to have a standard dialog here, when the user presses 'ok' i want the sheet to call a method, and when the user presses 'cancel' i want the sheet to go away without doing anything. seems simple enough. well, i can get the sheet to display, and i can even get the sheet to call the method i want. but.. instead of the method getting called only when a certain button is pushed on the sheet, it is ALWAYS called after the sheet has gone away. rather annoying. here is an example of the usage i've been using (called from my Controller object):

NSBeginAlertSheet(@"Alert", @"OK", @"Cancel", NULL, [self window], self, @selector(start), NULL, NULL, @"Press ok or cancel");

now, i have tried using all three possible buttons ( in the definition above: *defaultButton, *alternateButton, and *otherButton) with no success. i have also tried putting the selector in both the *didEndSelector position and the *didDismissSelector position, both with no luck, the method is called no matter what button is pushed. i have tried putting a selector in both places (in case it didn't like have one being NULL), still no luck.

i can not for the life of me figure out why the sheet is calling the method regardless of which button is pushed.

is anyone else having this problem?

any help would be greatly appriciated.

Jason Moore
email@hidden


  • Follow-Ups:
    • Re: problems with NSBeginAlertSheet
      • From: Eric Peyton <email@hidden>
  • Prev by Date: Re: Property List Question
  • Next by Date: Re: Newbie Question about the View
  • Previous by thread: Re: rangeOfString question
  • Next by thread: Re: problems with NSBeginAlertSheet
  • Index(es):
    • Date
    • Thread