iOS programming: The iphone lib package

Source: Internet
Author: User

Recently studied the package Lib, I experimented with 3 ways

The first way.

New Project-> IOS library->cocoa Touch Static Library This creates a new project for static libraries, placing the. m,.h you want to package into Lib, under the class directory, and then build. It's debug,release to be clear when packing.

The second way

1. Right-click on the targets of the project. ADD-> New target-> Static Library For example, we built a example target.

2. Put the m.h you want to pack into your new folder. Select one of the. m.h, then right-click Get info,taggets. Choose example, your own target is linked to these files.

3. In the project default target double-click, open general, in direct dependencies inside add example, so that the program in the compilation will generate this library, build, in the products inside will generate a. App, A file at the end of a lib. A is what you want.

The Third Way

1. As in the first way, we call a project

2. Project A to B. In the pop-up box, select Releate to project, so that A and B works on the link, in the B project targets double-click, open general, in direct dependencies, add a project target So that B will go to Builda when it is built, so that it is generated in a. A.

To sum up, feel the third way is the best. Inside B is the source of the test environment, in a inside is to package the Lib project. Side write code, side package lib, very good yes ...

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.