iphone 如何成功的把three20成功的添加到xcode中去。

1:原文摘自:http://three20.info/article/2010-10-06-Adding-Three20-To-Your-Project

Introduction

Before you begin using Three20 in your project, you should decide what directory layout works best for you.

Recommended: Shared Layout

In this layout, Three20 is shared between multiple projects. If you need to make project-specific modifications to Three20, use git branches.

If you are unfamiliar with git, it's highly recommended that you learn the basics in order to take advantage of this directory layout.

Directories

three20
projects/app1
projects/app2

Example workflow

# Work on app1
cd three20
three20 > git checkout app1                     # Check out app1's branch of modifications
three20 > open ../projects/app1/app1.xcodeproj  # Open app1 in Xcode
 
# Work on app2
three20 > git checkout app2                     # Check out app2's branch of modifications
three20 > open ../projects/app2/app2.xcodeproj  # Open app1 in Xcode
 
# Create a new app
three20 > git checkout -b app3 master           # Create a new branch, 'app3', at master
# <Create a new Xcode project in projects/app3>
# <Add Three20 to the new Xcode project using ttmodule>
 
# Update three20 when a new release is made
three20 > git fetch                       # Get the latest updates from Github
three20 > git rebase origin/master master # Fast-forward the local release to the latest release
three20 > git rebase master app1          # Update each app individually, fixing any merge conflicts

Submodule Layout

In this layout, Three20 lives directly within each project's folder as a git submodule. This layout can be useful if you don't plan to make modifications to Three20.

Directories

projects/app1
projects/app1/three20
projects/app2
projects/app2/three20

Example workflow

# Add Three20 to app1
cd projects/app1
projects/app1 > git submodule add git://github.com/facebook/three20.git three20
projects/app1 > git submodule init
projects/app1 > git add three20
projects/app1 > git commit -m "Add Three20 submodule"

Add Three20 to your project

There are two primary means of adding Three20 to your project. The first method is recommended and will automatically add Three20's libraries to your project and set up the necessary project settings. Sometimes this first method will fail, so you can fall back on the second method to add Three20 to your project by hand.

Automatically add Three20 to your project

Three20 includes a python script that adds Three20 to Xcode iOS projects. Running it without any arguments will print the script's help guide.

> python three20/src/scripts/ttmodule.py

In order to add Three20 to your project, it's recommended that you do the following:

> python three20/src/scripts/ttmodule.py -p path/to/myProject.xcodeproj Three20

This will add the Three20 module and all of its dependencies to your project.

If your target's name does not match your project's name, you will need to set it explicitly.

> python three20/src/scripts/ttmodule.py -p path/to/myProject.xcodeproj:myTargetName Three20

If the script displays errors, it's possible that your project is located in a folder with non-standard characters, such as spaces, that aren't being escaped properly. If this happens, it might be easiest to move your project to a path that doesn't contain spaces. If this is not an option, you can follow the manual directions below.

This screencast will walk you through the above process with the "Shared Layout" project layout.

 

posted on 2011-12-20 09:49  wtq  阅读(354)  评论(0编辑  收藏  举报