• 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: Eric Peyton <email@hidden>
  • Date: Fri, 26 Apr 2002 08:17:42 -0500

On Friday, April 26, 2002, at 07:25 AM, 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];
}

But this doesnt work because i have to define "result"...


int result;

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

if result == NSAlertDefaultReturn;

NSRun*Panel returns the result.

Eric


But i saw an example (Cant remember which) that the programmer without defining anything could get the result of buttons and make an action!
So i need help in figouring out how to get the result of the buttons!

T.I.A

Mamdouh
_______________________________________________
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.
_______________________________________________
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: Re: getting result of NSAlertPanel
  • Next by Date: NSTimer and screen noise [possibly OT]
  • Previous by thread: Re: getting result of NSAlertPanel
  • Next by thread: Problem with NSURL/CFURL, and/or web servers?
  • Index(es):
    • Date
    • Thread