NSRunCriticalAlertPanel doesn't behave as I expected.
NSRunCriticalAlertPanel doesn't behave as I expected.
- Subject: NSRunCriticalAlertPanel doesn't behave as I expected.
- From: Diggory Laycock <email@hidden>
- Date: Thu, 20 Dec 2001 16:41:40 +0000
having just read the docs for AlertPanels, I wrote the code below:
However when I test the app I get the following in the Log (whichever button
I pressed.)
2001-12-20 16:25:00.400 foobar[1570] NSAlertOtherReturn.
2001-12-20 16:25:02.861 foobar[1570] NSAlertDefaultReturn.
Does anyone have any ideas what's going wrong.
Please excuse me if this is a stupid question.
Thanks, Diggory.
#import "MyObject.h"
@implementation MyObject
- (IBAction)myAction:(id)sender
{
int alertResult;
alertResult=NSRunCriticalAlertPanel(@"Really remove?", @"really remove
the thing?" ,@"Cancel" ,@"OK" ,@"ho ho ho!");
if (alertResult=NSAlertAlternateReturn){ // If the user pressed "OK"
NSLog(@"NSAlertAlternateReturn.");
}
if (alertResult=NSAlertDefaultReturn){ // If the user pressed "cancel"
NSLog(@"NSAlertDefaultReturn.");
}
if (alertResult=NSAlertOtherReturn){ // If the user pressed "ho ho ho!
"
NSLog(@"NSAlertOtherReturn.");
}
}
@end