Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problems with NSBeginAlertSheet



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




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.