Re: programatically quit a program
Re: programatically quit a program
- Subject: Re: programatically quit a program
- From: Ken Thomases <email@hidden>
- Date: Thu, 28 Aug 2008 15:49:54 -0500
On Aug 28, 2008, at 3:38 PM, Wayne Shao wrote:
What is the correct way to quit a cocoa app? I could use C exit()
but that
would loose the chance to invoke the right callbacks for clean up.
What is the call that would be equivalent to user explicitly
selecting the
Quit from the menu.
I only found this
[[NSApplication sharedApplication] teminate:??];
You left the 'r' out of "terminate". :)
But the terminate function takes an id for sender. What shall I use?
In this case, you're the sender so you can pass "self". Or, if
you're within an action method (IBAction) you can forward the sender
that was passed to you.
In truth, I don't believe the -[NSApplication terminate:] method
makes any use of its sender parameter. It's only declared that way
to match the signature of an action method.
Cheers,
Ken
_______________________________________________
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