title: Multiple static libraries, swizzling and dispatch_once
body: <p>I have a main application, let's call it <strong>App</strong>.<br>
  It links two <em>static libraries</em>, <strong>StatLib1</strong> and <strong>StatLib2</strong>.<br>
  <strong>StatLib1</strong> links the <strong>StatLib2</strong> library.</p>
  
  <p>As you see, the <strong>StatLib2</strong> library is linked twice.</p>
  
  <hr>
  
  <p>In a category of the <strong>StatLib2</strong> library, I'm doing some swizzling:</p>
  
  <pre><code>+ (void)load {
      static dispatch_once_t onceToken;
      dispatch_once(&amp;onceToken, ^{
          NSLog(@"test");
  
          [self itk_swizzleInstanceMethodWithSelector:@selector(someMethod:)
                                      withNewSelector:@selector(itk_someMethod:)];
      });
  }
  </code></pre>
  
  <p><code>test</code> is logged twice, meaning the methods will be swizzled back to original.<br>
  I'm sure that this is the issue, since when I remove the link of <strong>StatLib2</strong> on the <strong>App</strong> target, this does not happen.</p>
  
  <hr>
  
  <ol>
  <li>First of all, why does this happen?</li>
  <li>How can I fix this, without actually removing the link to <strong>StatLib2</strong> on the <strong>App</strong> target?</li>
  </ol>