Re: Seeking a graceful way to end a program
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