Re: Quit Application
Re: Quit Application
- Subject: Re: Quit Application
- From: Fritz Anderson <email@hidden>
- Date: Sat, 4 Jun 2005 17:48:56 -0500
On 4 Jun 2005, at 5:35 PM, Connor Wakamo wrote:
Sorry if my posts seem easy to answer.
Your post would be easier to answer if it included not only a
statement of what you did, but why you found what you did
unsatisfactory. In other words, what your question is, and why you
are asking it.
I need a way to quit my application by pressing a button on the
window. I use this code:
[app terminate];
where app is the outlet representing my NSApplication.
First, you don't need to keep an outlet for your application. There's
a global, NSApp, for the application object.
Second, NSApplication does not define a terminate method. It does
define a terminate: method. The colon is significant. So your button
handler would be
- (IBAction) doQuitButton: (id) sender
{
[NSApp terminate: sender];
}
-- F
--
Fritz Anderson
Consulting Programmer
http://resume.manoverboard.org/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden