Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

static

iphone

I want to make .a file means static library of my project which I have made. How can I achieve this. Please provide me the the best solution, tutorial or any other links.

Thanks in advance

like image 779
Sanchit Paurush Avatar asked Feb 23 '23 00:02

Sanchit Paurush


1 Answers

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

Here are the basic steps:

  1. Understand that XIB/NIB/Storyboard files have to be included separately from the library
  2. Add a new target that is a static library
  3. In the build settings for that library, include all of the .h and .m files that are relevant. For example, if your app uses a set of classes to access data and another set to view that data, you may want to just include the files relevant to accessing data.
  4. Build. Use the script provided at Build fat static library (device + simulator) using Xcode and SDK 4+ so that you can use it for iPhone simulator + device.
  5. Include your library + headers + any resources in relevant project.
like image 53
tacos_tacos_tacos Avatar answered Apr 29 '23 01:04

tacos_tacos_tacos