Idan
Idan

Reputation: 5827

How to add existing Library to my iPhone project

So, Not a very sophisticated question, but since I never did it before I need your advice.

I have my main project, which includes 2 more sub projects that produces static libraries that the main project uses. Now, I want to add a Loggin framework to my project, and I want to be able to use it inside my main project and inside my static libraries as well. As you can witness here, it's not very hard, only 3 files needs to be included.

However, I'm not sure what's the best way to do it. Adding those 3 files to each of the projects would probably cause symbols redefinition. Adding to just one of the static libraries is not enough, unless I make the other one dependent on it, which is not quite correct logically. I can probably make another static library project from these 3 files, and make my project and my 2 other sub projects dependent on it, but it feels like an overkill.

What's the best course of action here ?

Thanks!

Upvotes: 0

Views: 563

Answers (1)

Julio Gorgé
Julio Gorgé

Reputation: 10106

Putting those files in yet another separate library or framework would be my take.

You should perhaps reconsider if you really need your sub projects precompiled in static libraries (what advantage is that providing to you? are they really that huge that recompiling them now and then is that bothersome?).

A single Xcode project with everything on it might be a better solution, and is what I usuallly favor these days. That way you also don't have to worry about missing architectures in your libs or having compiled the lib with a compiler version and the main project with another, bugs within the libs can be debugged and traced more easily, etc…

Upvotes: 1

Related Questions