title: The workspace with the iOS project and related a static library project
body: <p>I am fighting with Xcode 4 workspaces. Currently Xcode 4 wins. Thus, my situation:</p>
  
  <p>I have the workspace with the iOS app project. There is also static library project iOS app depends on in the this workspace.</p>
  
  <hr>
  
  <h2>Solution #1</h2>
  
  <p>I try to configure like this:</p>
  
  <ul>
  <li>the app project:
  <ul>
  <li>add to target's <em>Build Phases > Link Binary</em> With Library a product (<code>libmystaticlib.a</code>);</li>
  <li>set <code>USER_HEADER_SEARCH_PATHS</code> to <code>$(TARGET_BUILD_DIR)/usr/local/include $(DSTROOT)/usr/local/include</code>;</li>
  </ul></li>
  <li>the static library project:
  <ul>
  <li>add some header files to target's <em>Build Phases > Copy Headers > Public</em>;</li>
  <li>set <code>SKIP_INSTALL</code> to <code>YES</code>.</li>
  </ul></li>
  </ul>
  
  <p>And important thing: both projects must have configurations named the same. Otherwise, if I have, e.g., configuration named <em>Distribution (Ad Hoc)</em> for the app and <em>Release</em> for the static library, Xcode can't link the app with the library.</p>
  
  <p>With this configuration archiving results to an archive with the application and public headers from static library projects. Of course, I am not able to share <code>*.ipa</code> in this case. :(</p>
  
  <hr>
  
  <h2>Solution #2</h2>
  
  <p>I have also tried another configuration:</p>
  
  <ul>
  <li>Xcode preferences:
  <ul>
  <li>set source tree for the static library, e.g, <code>ADDITIONS_PROJECT</code>;</li>
  </ul></li>
  <li>the app project:
  <ul>
  <li>add to target's <em>Build Phases > Link Binary</em> With Library a product (<code>libmystaticlib.a</code>);</li>
  <li>set <code>USER_HEADER_SEARCH_PATHS</code> to <code>$(ADDITIONS_PROJECT)/**</code>;</li>
  </ul></li>
  <li>the static library project:
  <ul>
  <li>don't add any header files to Public!;</li>
  <li>set <code>SKIP_INSTALL</code> to <code>YES</code>.</li>
  </ul></li>
  </ul>
  
  <p>I still need to care about configuration names for both projects. But in result I can build and archive successfully. In the result I get archive and I can share <code>*.ipa</code>.</p>
  
  <hr>
  
  <p>I don't like the second solutions, because in this case I don't get any real advantage of the Xcode 4 workspace. The same effect I can add get, if I add the static lib project inside the app project. Therefore, I think something is wrong with my solution.
  Any suggestion how better to link a static libraries?</p>