• 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: Controlling initialization order
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Controlling initialization order


  • Subject: Re: Controlling initialization order
  • From: "b.bum" <email@hidden>
  • Date: Tue, 25 May 2004 10:05:39 -0700

On May 24, 2004, at 8:46 PM, David Catmull wrote:
How do I control the order in which global objects are initialized? In CodeWarrior I can go to the Link Order tab and drag things around, but I can't find a similar thing in XCode.

The initialization order of C++ objects is unspecified across "translation units" (effective oversimplification: across source files). That CodeWarrior (or other IDE/compiler/linkers) guaranteed the order based upon link order is a feature that isn't within the specification.


http://www.devx.com/getHelpOn/10MinuteSolution/17803/1954?pf=true
http://www.devx.com/getHelpOn/10MinuteSolution/17803

I liked this explanation:

http://users.utu.fi/~sisasa/oasis/cppfaq/ctors.html#[10.9]
http://users.utu.fi/~sisasa/oasis/cppfaq/ctors.html#[10.10]

The same holds true for ObjC and the +load and/or +initialize methods; order is not guaranteed.

http://tinyurl.com/327ad
(Apple doc on +load)

b.bum
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Controlling initialization order
      • From: David Catmull <email@hidden>
References: 
 >Controlling initialization order (From: David Catmull <email@hidden>)

  • Prev by Date: add jar to class browser
  • Next by Date: Code completion of member functions / attributes?
  • Previous by thread: Re: Controlling initialization order
  • Next by thread: Re: Controlling initialization order
  • Index(es):
    • Date
    • Thread