Re: Exit an Application
Re: Exit an Application
- Subject: Re: Exit an Application
- From: Uli Kusterer <email@hidden>
- Date: Mon, 13 Apr 2009 23:52:15 +0200
On 13.04.2009, at 16:19, Filip van der Meeren wrote:
You could always call exit(); from C
or [NSApp terminate:XXX];
Well,
calling exit() is the best way to shoot yourself in the foot. That
would exit the app immediately, without saving any unsaved documents,
without writing any cached NSUserDefaults changes to the hard disk
etc. Its effect in a regular Cocoa application is only slightly better
than choosing "Force Quit" and shooting down the app. In short, don't
do it.
[[NSApplication sharedApplication] terminate: nil];
or the slightly shorter and a thoretically a tad more dangerous
similar call with NSApp in it are really the only option. (Well,
theoretically you could send yourself a "quit" Apple Event, but that's
only of academical interest...)
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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