• 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: earliest code that runs?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: earliest code that runs?


  • Subject: Re: earliest code that runs?
  • From: Shaun Wexler <email@hidden>
  • Date: Thu, 29 Jul 2004 13:53:05 -0700

On Jul 29, 2004, at 7:21 AM, Matt Neuburg wrote:

>> In that case you might be able to use applicationWillFinishLaunching:
>
> Nope, not early enough. :)
>
> What I was looking for was code that is guaranteed to run before the
> initWithFrame: of this widget, yet is not in the class for this widget
> but
> rather in some more general, controller-like location. So far, main()
> as
> recommended by bbum is the only place I've found for that, and that's
> fine
> with me.

Any +load methods in the main executable will be called before main().

> The docs on binding to user defaults seem to imply that the app
> delegate's
> +initialize will run before any instance methods

Not necessarily, especially if you instantiate your app delegate object
in the main nib file.

>> The example in Listing 2 loads the default values from a file in the
>> application wrapper, registers those values with NSUserDefaults, and
>> then
>> registers a subset of the values as the initial values of the shared
>> user
>> defaults controller. The setupDefaults method would be called from
>> your
>> application delegate9s initialize class method
>
> If so, that must be an urban legend. Anyhow, one of the things I like
> about
> science is that one counterexample suffices to disprove the
> hypothesis. My
> app is a counterexample. m.

You can also subclass (or pose) NSApplication and override
-finishLaunching.
--
Shaun Wexler
MacFOH
http://www.macfoh.com

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.


References: 
 >Re: earliest code that runs? (From: Matt Neuburg <email@hidden>)

  • Prev by Date: troubles with tables (editing)
  • Next by Date: Re: The problem with bindings
  • Previous by thread: Re: earliest code that runs?
  • Next by thread: Re: earliest code that runs?
  • Index(es):
    • Date
    • Thread