iphone 下Three20库(From Facebook)的设置使用方法

原文地址:http://www.cnblogs.com/chen1987lei/archive/2010/03/10/1682796.html

Three20是一个编译的静态类库,在Xcode中的项目实用此类库也非常方便,以下是一些基础步骤:

1,从Three20 Git上获 取 最新文 件 ,在终端命 令 输入:git clone git://github.com/joehewitt/three20.git,必须确保此项目文件必须有一个固定的存放路 径 ,因为你的项目如果实用此类库,在XCode中需要引用此项目(说明:Git是一种版本控制器,也就类似于源代 码 管理的东西了,如果还没安装,请到下面网址下 载http://git-scm.com/download ,并进行安装)

2,经过一些时间下载数据后打开“Three20.xcode proj”, 一般项目想在的默认路径会在”/computerName/Document/three20″中的”src”文件夹中。 把”Three20.xcodeproj”拖入到你的项目中的”Groups and Files”中的”Framworks”类目中。出现对话框后,取消选择”Copy item”,在“Reference Type”的选项中选中” Relative To Project” ,然后点击”Add”

3,现在你需要在你的项目中关联Three20的静态类库。点击刚才添 加的”Three20.xcodeproj”,在右侧”Details”里选中最后一个复选框

4,增加Three20作为 dependency,这样Xcode才能正确编译Three20:打開 Targets并双击你的target,在General标签下的的Direct Dependencies按“+”后选择Three20,最后按下 Add Target

5,在src中找到Three20.bundle并拖入项目,在跳出的对话框中的选中 Create Folder References,取消选择Copy items,Reference Type中选择 Relative to Project

6, 加入 Core QuartzCore.framework

7,加入搜寻路径:
打开Project Settings并切换到Build
在Search Paths分类找到Header Search Paths于你的项目相对 three20/src 的相对路径 (如 “http://www.cnblogs.com/../3rdLibrarys/three20/src”)
在Linker分类下找到 Other Linkder Flags新增“-ObjC”和”-all_load”

8,最后实用时只需加入#import “Three20/Three20.h”就ok了

原文地 址 http://github.com/joehewitt/three20

Three20 is compiled as a static library, and the easiest way to add it to your project is to use Xcode’s “dependent project” facilities. Here is how:Clone the three20 git repository: git clone git://github.com/joehewitt/three20.git. Make sure you store the repository in a permanent place because Xcode will need to reference the files every time you compile your project.Locate the “Three20.xcodeproj” file under “three20/src”. Drag Three20.xcodeproj and drop it onto the root of your Xcode project’s “Groups and Files” sidebar. A dialog will appear — make sure “Copy items” is unchecked and “Reference Type” is “Relative to Project” before clicking “Add”.Now you need to link the Three20 static library to your project. Click the “Three20.xcodeproj” item that has just been added to the sidebar. Under the “Details” table, you will see a single item: libThree20.a. Check the checkbox on the far right of libThree20.a.Now you need to add Three20 as a dependency of your project, so Xcode compiles it whenever you compile your project. Expand the “Targets” section of the sidebar and double-click your application’s target. Under the “General” tab you will see a “Direct Dependencies” section. Click the “+” button, select “Three20″, and click “Add Target”.Now you need to add the bundle of images and strings to your app. Locate “Three20.bundle” under “three20/src” and drag and drop it into your project. A dialog will appear — make sure “Create Folder References” is selected, “Copy items” is unchecked, and “Reference Type” is “Relative to Project” before clicking “Add”.Now you need to add the Core Animation framework to your project. Right click on the “Frameworks” group in your project (or equivalent) and select Add > Existing Frameworks. Then locate QuartzCore.framework and add it to the project.Finally, we need to tell your project where to find the Three20 headers. Open your “Project Settings” and go to the “Build” tab. Look for “Header Search Paths” and double-click it. Add the relative path from your project’s directory to the “three20/src” directory.While you are in Project Settings, go to “Other Linker Flags” under the “Linker” section, and add “-ObjC” and “-all_load” to the list of flags.You’re ready to go. Just #import “Three20/Three20.h” anywhere you want to use Three20 classes in your project.Three20 is compiled as a static library, and the easiest way to add it to your project is to use Xcode’s “dependent project” facilities. Here is how:

Clone the three20 git repository: git clone git://github.com/joehewitt/three20.git. Make sure you store the repository in a permanent place because Xcode will need to reference the files every time you compile your project.

Locate the “Three20.xcodeproj” file under “three20/src”. Drag Three20.xcodeproj and drop it onto the root of your Xcode project’s “Groups and Files” sidebar. A dialog will appear — make sure “Copy items” is unchecked and “Reference Type” is “Relative to Project” before clicking “Add”.

Now you need to link the Three20 static library to your project. Click the “Three20.xcodeproj” item that has just been added to the sidebar. Under the “Details” table, you will see a single item: libThree20.a. Check the checkbox on the far right of libThree20.a.

Now you need to add Three20 as a dependency of your project, so Xcode compiles it whenever you compile your project. Expand the “Targets” section of the sidebar and double-click your application’s target. Under the “General” tab you will see a “Direct Dependencies” section. Click the “+” button, select “Three20″, and click “Add Target”.

Now you need to add the bundle of images and strings to your app. Locate “Three20.bundle” under “three20/src” and drag and drop it into your project. A dialog will appear — make sure “Create Folder References” is selected, “Copy items” is unchecked, and “Reference Type” is “Relative to Project” before clicking “Add”.

Now you need to add the Core Animation framework to your project. Right click on the “Frameworks” group in your project (or equivalent) and select Add > Existing Frameworks. Then locate QuartzCore.framework and add it to the project.

Finally, we need to tell your project where to find the Three20 headers. Open your “Project Settings” and go to the “Build” tab. Look for “Header Search Paths” and double-click it. Add the relative path from your project’s directory to the “three20/src” directory.

While you are in Project Settings, go to “Other Linker Flags” under the “Linker” section, and add “-ObjC” and “-all_load” to the list of flags.

You’re ready to go. Just #import “Three20/Three20.h” anywhere you want to use Three20 classes in your project.

你可能感兴趣的:(xcode,项目管理,git,Facebook,Go)