• 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
Re: app delegate +initialize
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: app delegate +initialize


  • Subject: Re: app delegate +initialize
  • From: Graham Cox <email@hidden>
  • Date: Fri, 9 Oct 2009 10:28:45 +1100


On 09/10/2009, at 3:20 AM, Fritz Anderson wrote:

It's better to initialise your defaults in your app delegate's - applicationWillFinishLaunching: method, since it is called at a completely invariant time during the launch process.

Could you clarify? -[AppController applicationWillFinishLaunching:] would be called on the AppController instantiated from the NIB, would it not? And applicationWillFinishLaunching: being the first use of that class, won't +[AppController initialize] be called first?


No, I don't think this would be the case. Of course, you could try it to be sure, but when the app delegate is instantiated from the nib, it will be initialised in some way (e.g. with -init or -initWithCoder:) which will trigger +initialize. The app will call its - applicationWillFinishLaunching: much later - when the whole nib has long been loaded, connected, etc and in fact, when the app is good and ready to finish launching, as the method's name implies. In other words the state of things at +initialize time is far less predictable than it is at -applicationWillFinishLaunching time.

--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


References: 
 >Re: app delegate +initialize (From: John Baldwin <email@hidden>)
 >Re: app delegate +initialize (From: John Baldwin <email@hidden>)
 >Re: app delegate +initialize (From: Jens Alfke <email@hidden>)
 >Re: app delegate +initialize (From: John Baldwin <email@hidden>)
 >Re: app delegate +initialize (From: Graham Cox <email@hidden>)
 >Re: app delegate +initialize (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: debugging cursors
  • Next by Date: Re: debugging cursors
  • Previous by thread: Re: app delegate +initialize
  • Next by thread: Re: app delegate +initialize
  • Index(es):
    • Date
    • Thread