• 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: Seeking a graceful way to end a program
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Seeking a graceful way to end a program


  • Subject: Re: Seeking a graceful way to end a program
  • From: Paul Johnson <email@hidden>
  • Date: Thu, 29 Apr 2010 17:53:24 -0500

Thanks, Jens, that was what I needed. I did use "exit(0)" instead of
"exit(1)" though. When I used the latter and ran the program from
Xcode, the program terminated but Xcode was not informed of that fact.
(I had to click on the red stop sign in Xcode to tell it the program
had ended. Maybe this is a bug -- looks like that to me at least.)

On Thu, Apr 29, 2010 at 3:14 PM, Jens Alfke <email@hidden> wrote:
>
> On Apr 29, 2010, at 12:56 PM, Paul Johnson wrote:
>
>> I found one possible tip in "Cocoa Design Patterns" (p. 253.) The
>> sample code uses NSRunAlertPanel(). I'd like to display an alert and
>> then perform an exit(1). (Somewhere I need to handle a click on a
>> "Quit" button in the Alert.)
>
> Sure. Just call NSRunCriticalAlertPanel, then call exit(1). Presumably you
> only want one button in the panel ("Quit" or "Uh, Sorry") so there's not
> even any need to check the return value.
>
> —Jens
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Seeking a graceful way to end a program
      • From: Jens Alfke <email@hidden>
References: 
 >Seeking a graceful way to end a program (From: Paul Johnson <email@hidden>)
 >Re: Seeking a graceful way to end a program (From: Fritz Anderson <email@hidden>)
 >Re: Seeking a graceful way to end a program (From: Paul Johnson <email@hidden>)
 >Re: Seeking a graceful way to end a program (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Help with text input
  • Next by Date: Re: NSTask objectalloc problem
  • Previous by thread: Re: Seeking a graceful way to end a program
  • Next by thread: Re: Seeking a graceful way to end a program
  • Index(es):
    • Date
    • Thread