Mahek
Mahek

Reputation: 233

iPhone static lib

i want to share some code with other iOS projects. So I create static library. When I use this library in other projects and use header file from that lib I get an error like No such file and Directory. Can any one tell me fixes of it.

Here I get reference for making static lib
http://www.amateurinmotion.com/articles/2009/02/08/creating-a-static-library-for-iphone.html

I downloaded that sample. It is also not working in my case. So please help me to fix that error.

Thanks in advance

Upvotes: 1

Views: 205

Answers (1)

drekka
drekka

Reputation: 21903

My guess would be because the blog, whilst detailed, is probably a bit old now. Like anything there's a thousand ways to skin a cat.

You can now create frameworks for the iPhone sdk and include both simulator and device versions of the classes. Frameworks have the advantage that they can simply be dragged and dropped on Xcode to include them in a project. In addition I like to store my frameworks in version numbered directories so if I make changes, dependent projects can still use the old ones until I'm ready to update them.

I don't do it, but for the above reasons I'm not sure I'd drag and drop a libs project on a client project. To me the idea of a static framework is that it's independent on it's clients. Dropping it into client projects makes a connection between the two projects that is too tight.

Anyway do some searches on lipo and static frameworks. I also have so scripts in my project at https://github.com/drekka/dUsefulStuff that you mint find useful.

Upvotes: 1

Related Questions