IOS static library

Source: Internet
Author: User

1. Apple does not allow calling external frameworks and DLL, so it is two methods to use open source code to pour the source code into the project or make a static library.

2. The architecture of the library used on the simulator and device is different. The former is i386 and the latter is armv6 and 7. So if you do the database, you can see what it is used. You can use commands to view the architecture of your database.

Lipo-info/path/to/Your/library.

3. How to import the imported header file

C code, headers is usually used in this way # include <fuck. h>. If we use this method, xcode directly reports an error, prompting that such a header file cannot be found. Right-click your project name and select get info. On the build tab, the search hearder path option is available. Is to let you tell xcode where to search for the header file.

 

============

1. Drag. xcodeproj of the static library to the frameworks directory of the project.
2. Drag the. A file of the static library to the frameworks directory. Do not select "Copy items ..."
3 Add "target dependencies"
4. Add the header file path to "header search path"
5. Directly import the header file during the call.
# Import "JSON. H"

 

============

Xcode 4.2

1. xcode4-> Target-> build phases-> link binary with libraries-> add items
2. Add the header file of the corresponding Library to the code.

 

============

1. Add the project file of the library directly in the framework (this step does not know if it is necessary. In this case, all the library files will be visible)
2. Click the total project file in the tree structure in the upper left corner and select your project target file in the intermediate target file.
3. Select the build phases tag on the right.
4. Select the library compilation file (. A) in link binary with library)
5. Create a link between the target file and the library file, and add the Library to the target dependencies label on link binary with liibrary.
6. compile.

Address: http://hi.baidu.com/marktian/item/39803f8f37ab13834414cff8

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.