• 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
NSRunCriticalAlertPanel doesn't behave as I expected.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSRunCriticalAlertPanel doesn't behave as I expected.
      • From: David Remahl <email@hidden>
  • Prev by Date: Re: AutoreleasePool mechanics
  • Next by Date: Re: NSRunCriticalAlertPanel doesn't behave as I expected.
  • Previous by thread: Re: (OT) auto-indent a big hit here
  • Next by thread: Re: NSRunCriticalAlertPanel doesn't behave as I expected.
  • Index(es):
    • Date
    • Thread