• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
App Delegate starting up
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: App Delegate starting up
      • From: Bill Cheeseman <email@hidden>
  • Prev by Date: Making an object accessible by both MyDocument AND a custom class
  • Next by Date: multi user develloping
  • Previous by thread: Re: Making an object accessible by both MyDocument AND a custom class
  • Next by thread: Re: App Delegate starting up
  • Index(es):
    • Date
    • Thread