6

Are there any tutorials describing how to create a library or is it framework for the iPhone? I have a number of methods that are shared between applications. These will be better maintained as a library.

4thSpace
  • 43,672
  • 97
  • 296
  • 475

3 Answers3

3

Put your code in a static library (as Roger indicated via his link). However, consider using an Xcode cross-project reference to "import" that static library into all the other projects that need it. I've whipped up a tutorial explaining how to do this (and why I think it's better than creating a "fat" Universal Binary): http://www.clintharris.net/2009/iphone-app-shared-libraries/

clint
  • 14,402
  • 12
  • 70
  • 79
2

There is a lot of information on the web that can help with this for example this.

Rog
  • 17,070
  • 9
  • 50
  • 73
0

A much more recent (and more powerful) way to do the "single library file that covers both simulator and devices":

Build fat static library (device + simulator) using Xcode and SDK 4+

(I wrote one of the posts referred to in the accepted answer; that was valid for Xcode3 at the time, but Apple deliberately broke it with later versions, and offered no alternative. So, we ended up with the SO question / answer above)

Community
  • 1
  • 1
Adam
  • 32,900
  • 16
  • 126
  • 153