5
votes

I can't figure out how to create a cocoa touch static library in Xcode 4.

I've created static library in Xcode 3 and it worked fine. I used this tutorial. Thanks for the help.

First step I create cocoa touch static library

enter image description here

Next we can see our static library in product directory. But now this uncompiled library.

enter image description here

Next step I add some objective-c class. This class is will perform various actions, for example show NSLog messages.

enter image description here

Then I made sure there is this class exist in compile source

enter image description here

After that I build my target

enter image description here

Now I use this static library in other projects, but when I use it I get a error when linking files with my static library.

3
You didn't specify the problem you are facing! - Ravi
create a static library in the XCode3 and XCode4 are different - this is my problem - Matrosov Oleksandr
Different, but how different? - gcamp
when i use xcode 3 for creating static library i follow next step: - first i add new target and choice 'cocoa touch' -> 'static library' - next after adding library i drag into compiling sources my class .m - next i build my static library - Matrosov Oleksandr
but I do not know how to repeat these steps in the XСode 4 - Matrosov Oleksandr

3 Answers

1
votes

Open Xcode > Create New Project > iOS > Framework & Library > Cocoa Touch Static Library

1
votes

I struggled with this myself and, on another SO thread, found this:

iOS-Universal-Framework

0
votes

To create an static library you can try to figure out with example example here: http://www.raywenderlich.com/41377/creating-a-static-library-in-ios-tutorial