How to add Three20 in iPhone Development

Source: Internet
Author: User

IPhone DevelopmentAboutThree20The method is described in this article,Three20IsIPhone DevelopmentA collection of graphic interface classes, including image viewing, general tools, and local HTTP cache.Three20It is from the source code of Facebook's iPhone program.

Add Three20 to your program

Three20 is a pre-compiled static library. The simplest method is to use Xcode's dependency engineering features. The following method is used:

1. Copy the Clone command) three20 gitGitHub Directory: 'git clone git: // github.com/joehewitt/three1_git'. Ensure that it is stored in a common location so that Xcode can index and access it at every compilation.

2. Find "three1_xcodeproj" in "three20/src ". drag Three20.xcodeproj to the "Groups and Files" root directory of your project. in the displayed dialog box, remove the "Copy items" check box, select "Relative to Project" for "Reference Type", and click "Add ".

3. Now you need to link the Three20 library to your project. Click the added "three1_xcodeproj". In the "Details" table, you will see libthree1_a. Mark it with the check mark on the right of the file.

4. Now you need to set the 320 Library as the dependent library of your program so that Xcode will compile 320 together during compilation. Expand the "Targets" tab on the left and double-click the "project" file of your program. Under the "General" tab, you will see "Direct Dependencies" and click "+" to add the 320 database.

5. Now you need to add images and strings to your program, find threebundle in three20/src, and drag it to your program. Select "Copy items" in the dialog box, and select "relative to project" for "reference type"

6. Now, you need to add the Core Animation framework to your project. Click the target program and add QuartzCore. framework in frameworks. This is not a translation, and the original method is too troublesome.

7. Finally, we need to find the header of the 320 library for your project. Open "Project Settings", find "Build", find "Header Search Paths", and double-click it. The address of the relative directory to "three20/src.

8. In Project Settings, find "Other Linker Flags" and add "-ObjC" and "-all_load" in the "Linker" area ".

9. OK. Add # import "Three20/three1_h" in the place where the 320 library is used.

The above is a Chinese translation of the official step.

Below is a brief overview.

Drag Three20.xcodeproj to the project directory,

Drag Three20.bundle to the project directory

Expand Three20.xcodeproj and check libThree20.a.

For the latest three20 version, you can add the required modules. You need to add Three20Core. xcodeproj, Three20Network. xcodeproj, and so on, as shown in the preceding step.

Expand Targets settings. Under the current General tab, add Three20 as long as three20 is added by clicking "+" in the upper column)

Add framework: Core Animation framework QuartzCore. framework

Preparation: run the three20 project using xcode. In the Build menu, run bulid once to ensure that the build directory is generated under the Three20 file directory.

Key: Find the "Build" tag in the Project name "Project Settings", find "Header Search Paths", double-click it, and add

In the build directory under the Three20 directory, go to the three20 address and obtain the full path of the folder information-similar to "...... Three20/Build/Products/three20"

You can first find Build/Products/three20 to open the show introduction and find the complete path (my path is/Users/gushuo/three20/Build/Products/three20)

Find "Other Linker Flags" and add "-ObjC" and "-all_load" in "Linker ".

The key lies in the red part. The path is definitely not properly configured. It should also be the header file officially translated by three20 under the build directory. It may be set for both Build and Debug. If you use the Three20 template to create a project, note that the project must be saved in the directory where the three20 source code is located.

Summary:IPhone DevelopmentAboutThree20The content of the add method has been introduced. I hope this article will help you!

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.