App Delegate starting up
App Delegate starting up
- Subject: App Delegate starting up
- From: email@hidden
- Date: Wed, 25 Sep 2002 00:34:02 EDT
This is probably a simple question, but I seen many examples with different
ways to do this.
When is the best time for an Applications Delegate to execute startup code
like reading defaults, loading data files and placing various application
windows up? And the opposite question, when is the best time to clean up
during termination?
Many of the examples use either the delegates -init or -awakeFromNib to
handle starting up the application. Other apps use the notification center,
and wait for -NSApplicationDidFinishLaunchingNotification or
-NSApplicationWillFinishLaunchingNotification events. If you override a
NSApp, you could directly override the -finishLaunching call. Or if you are
using an App delegate, are recommended, you can use
-applicationDidFinishLaunching.
I will leave it to you to make the list of locations to place the termination
code (like saving the defaults, saving application data files, placing Banner
goodbye windows).
For both cases, to many choices!
Most people seem to use the -awakeFromNib, but it would look to me the
-applicationDidFinishLaunching is better.
What is best?
Thanks!
Steve Sheets
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.