How to create a static library of an existing project in objective-c (.a file)?

I want to create a .a file, this is the static library of my project that I created. How can i achieve this. Please provide me with the best solution, tutorial or any other links.

Thank you in advance

+4
source share
3 answers

http://mobileorchard.com/sharing-compiled-code-building-static-libraries-in-xcode-for-the-iphone/ has a good tutorial.

Here are the basic steps:

  • Understand that XIB / NIB / Storyboard files must be included separately from the library
  • Add new target, static library
  • In the build settings for this library, specify all the corresponding .h and .m files. For example, if your application uses a set of classes to access data and another set to view this data, you can simply include files related to data access.
  • Build. Use the script provided in create a full static library (device + simulator) using Xcode and SDK 4+ so you can use it for iPhone simulator + device.
  • Add to your library + headers + any resources in the corresponding project.
+5
source

With xcode4.2, the easiest way is to create a new project, iOS / Framework and library, CocoaTouch Static Library and add all your files.

+2
source

Here is a simple tutorial with which I created a static library in iphone. After creating the static library, you import the library .a file and the .h header file into your new project and use them. Here is a link to create a static library .

+1
source

Source: https://habr.com/ru/post/1388258/


All Articles