Re: Cocao Quit Application
Re: Cocao Quit Application
- Subject: Re: Cocao Quit Application
- From: Bryan Henry <email@hidden>
- Date: Fri, 20 Jun 2008 00:49:14 -0400
This is off-topic for this list, you should try Cocoa Dev in the future.
[NSApp terminate:self] should work, as long as you don't have modal
windows or such open since it will check applicationShouldTerminate:
for that to work. The absolute sure-fire way to kill the application
is to go to C and use "exit(SUCCESS_CODE_HERE)", but that doesn't do
anything cleanly at all so you wouldn't want to use that for an app
with file operations or networking and such. The clean way is to just
use -[NSApplication terminate:].
P.S.
NSApp is a shortcut for [NSApplication sharedApplication]
Bryan
On Jun 20, 2008, at 12:35 AM, Romain Marucchi wrote:
What is the obj-c code to make an application quit ie: on an click,
similar as Apple Key + Q?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
@mac.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden