• 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: getting result of NSAlertPanel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getting result of NSAlertPanel


  • Subject: Re: getting result of NSAlertPanel
  • From: email@hidden
  • Date: Fri, 26 Apr 2002 14:56:18 +0200

On vendredi, avril 26, 2002, at 02:25 , Mamdouh wrote:

Hi...

This a very simple (probably newbie) question. I have a NSInformationalAlertPanel and i want to get the result of the button selected by the user, so i can make some kind of action for that button...
heres a snip:
<<<<<<<<<<<<

if ( [YadaYadaYada:moreYada] )
{
NSRunInformationalAlertPanel(@"Title", @"InformationText", @"OK", @"Later", @"Cancel",nil);
}

<<<<<<<<<<<<<

I looked inside the TextEdit example and it does something like this:

if (result == NSAlertDefaultReturn) {
[SomeKindofAction];
}

I'm not sure to understand. Why don't you just do this?

int result;

result= NSRunInformationalAlertPanel(@"Title", @"InformationText", @"OK", @"Later", @"Cancel",nil);

switch(result)
{
case NSAlertDefaultReturn: // OK
break;
case NSAlertAlternateReturn: // Later
break;
case NSAlertOtherReturn: // Cancel
break;
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >getting result of NSAlertPanel (From: Mamdouh <email@hidden>)

  • Prev by Date: Problem with NSURL/CFURL, and/or web servers?
  • Next by Date: Re: getting result of NSAlertPanel
  • Previous by thread: getting result of NSAlertPanel
  • Next by thread: Re: getting result of NSAlertPanel
  • Index(es):
    • Date
    • Thread