title: In what order methods +initialize and +load called?
body: <p>Lets imagine that we have two classes:</p>
  
  <pre><code>@interface First : NSObject
  
  @end
  
  @interface Second : NSObject
  
  @end
  
  @implementation First
  +(void)load
  {
      NSLog(@"This must be called first");
  }
  @end
  
  @implementation Second
  +(void)load
  {
      NSLog(@"And this must be called second");
  }
  @end
  </code></pre>
  
  <p>We have <code>+load</code> methods in each class. If we run this code, <code>This must be called first</code> will be first and <code>And this must be called second</code> will be second. </p>
  
  <p>What determines the order in which the <code>+load</code> methods of this classes are called? In my experiment, if I move <code>@implementation</code> of second class before <code>@implementation</code> of first class - <code>And this must be called second</code> is printed first and <code>This must be called first</code> is printed second. Is this means that <code>+load</code> order depends only from order in source code? </p>
  
  <p>In my real case I have precompiled framework with custom <code>+load</code> (some code are called before <code>main()</code> and I see logs from it), and I need to execute my code before this code (and as I understand - I can place it into <code>+load</code>, but I don't know how to change order). Or may be I can call my code before framework code with some other technique?</p>