title: How to build an Objective-C static library?
body: <p>I have some Objective-C classes, which I am currently using in both a Cocoa application (Mac OS X) and a Cocoa-Touch application (iOS). Currently, when I update those classes, I have to copy those updated <code>.h</code> and <code>.m</code> files to both projects. Not that big of deal, but I'm going to be using them in many more projects.</p>
  
  <p>So, I want to build these classes into an Objective-C static library. And then link against that library in all other projects. </p>
  
  <p>Is there a way to build a static library such that it works with both Cocoa and cocoa-touch applications?</p>
  
  <p>I've tried just building a Cocoa static library with these classes, but I get various errors when I try to link against that library in my Cocoa application, and I'm sure that they are coming from the fact that I am not doing it right.</p>
  
  <p>So, how do I build an Objective-C static library the <em>right</em> way? Do I have to build both a Cocoa-Touch and Cocoa static library? Or can I just do one? How is this done? </p>
  
  <p>Are there any well-done tutorials on this subject? </p>
  
  <p>I have searched the web and cannot seem to find a comprehensive tutorial on this subject, so I've posed the question here, in hopes that a great answer will be posted and this question can serve as a resource for me and for future questioners.</p>