turn from: http://blog.csdn.net/sunyuanyang625/article/details/18790733
Today, a friend asked a question, engineering reference to other projects how to achieve, can be modified in the project, explained a long time I know he asked is actually static library.
Generally for their own development process of the static library will not be closed source, mainly for later expansion and modification, this time to use the so-called can be modified in the project static library.
Create a static library first
Write a simple method for testing, here is given is just an output print
OK, implement this method in. m
Compile it without running it. Whether you compile or not compile will find the products under the. A file is red, it does not matter, do not delay the use. But you must compile
Find the project in the Finder
Open the project where you need to refer to the static library, where I've created a new project and dragged the libary.xcodeproj in the Finder into your project.
Here is a very important question about whether the static library can be used.
1. Add the. A file in the static library in link binary with libaries
2. To introduce a static library of. h files. If you have a lot of static library classes, it's best to put all the. h files in the same. h, and we often find that when we call some Third-party SDK, we can refer to all the. h in its library by referencing only one. h file, which is encapsulated. You can call the method test when you're done.
The method call succeeded. How to modify the static library in this project
Then look at the print results
And she's a damn success.