Xcode of engineering references, iOS static library

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.