Re: Best practice for terminating at launch time?
Re: Best practice for terminating at launch time?
- Subject: Re: Best practice for terminating at launch time?
- From: Graham Cox <email@hidden>
- Date: Wed, 11 Feb 2009 11:46:54 +1100
On 11 Feb 2009, at 11:08 am, Rob Keniger wrote:
You can do something like the following in -
applicationDidFinishLaunching:
if([alert runModal] == NSAlertFirstButtonReturn)
{
exit(0);
}
else
{
[NSApp applicationOpenUntitledFile:NSApp];
}
A straight exit() may not be elegant but it certainly works just fine.
OK, that's fine for the termination part - thanks!
The problem with the code you outline though is that the call to -
runModal runs the event loop which allows the untitled document to
continue to open behind the alert. I'd like to discover a way to avoid
that if possible.
--Graham
_______________________________________________
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