`

A Visual Guide to Manually Adding Three20 to your Xcode 4 Project

    博客分类:
  • ios
 
阅读更多

 

Three20 is a modular open source Objective-C library used by numerous applications in the App Store, including well-known brands such as Facebook, Meetup.com, Pulse, etc. It provides developers with powerful view controllers built on top of the existing iOS framework.

A comprehensive set of  instructions on how to add Three20 to your project both manually and automatically for Xcode 3 can be found on their website. Along with that there is also a nice little transition guide for Xcode 4 users on the automatic method of adding Three20 to your project. As a developer that has just recently transitioned from Xcode 3 to Xcode 4, manually adding Three20 and figuring out where exactly you can add dependency targets and link libraries was a bit of a hunting game. So here is a little visual guide based on the original instructions provided by Three20:

1) Get the code Clone the three20 git repository: git clone git://github.com/facebook/three20.git

2) Locate the “Three20.xcodeproj” file under “three20/src/Three20/”. Drag Three20.xcodeproj and drop it onto the root of your Xcode project’s “Groups and Files” sidebar. If a dialog appears — make sure “Copy items” is unchecked and “Reference Type” is “Relative to Project” before clicking “Add”. Open the Three20 Xcode Project that you just added to your app and expand the “Dependencies” group. Select all of the projects listed there and drag them to your app as well. You should now have the following list of Three20 projects added to your app:

 

  • Three20Core
  • Three20Network
  • Three20Style
  • Three20UICommon
  • Three20UINavigator
  • Three20UI
  • Three20


  •  4) Link the Three20 static libraries to your project. To do this, select your project on the sidebar and then select your target on the detail view that shows up in the editor pane. Select the “Build Phase” tab and you will see an option for “Link Binary With Libraries”. Click on “+” and you will see a number of items, such as libThree20.a and libThree20Core.a under the Workspace folder. Select each of the lib files (not the UnitTests) and add. This will link each part of the Three20 framework to your app.


  •  5) Add Three20 as a dependency of your project, so Xcode compiles it whenever you compile your project. This can be accomplished at the “Build Phase” tab as well. There will be a similar option to add Target Dependencies. As we did before, just click on “+”, select “Three20″ and each of the other libs and add it to the project. You do need to add the UnitTests target for each lib.

     6) While we are at the “Build Phase” tab, Add the Core Animation framework to your project. This can be found under “Link Binary With Libraries”. Locate QuartzCore.framework and add it to the project.

    7) 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”.

    8 ) Finally, tell your project where to find the Three20 headers. Open the “Build Settings” tab that is located next to the “Build Phase” tab and look for “Header Search Paths” and double-click it. Add the relative path from your project’s directory to the “three20/Build/Products/three20″ directory.



     9) While you are in Build Settings, go to “Other Linker Flags” under the “Linker” section, and add “-ObjC” to the list of flags. WARNING: Make sure that you do this for all configuration settings, not just the active one.

    10) You’re ready to go. Just #import “Three20/Three20.h” anywhere you want to use Three20 classes in your project. It’s recommended that you do so in a precompiled header for faster build times.

    ** Additional Tips/Steps by Ron Cirka **

    Make sure to add both “-ObjC” AND “-all_load” to the linker flags. The configuration name should be one word, eg. “adhoc” NOT “ad hoc”. You can try adding quotes in the path if you want to use a multiple word configuration name, but that may not always work. Otherwise you’ll get the dreaded – import “Three20/Three20.h” no such file or directory – when trying to archive.

    也可以使用命令行导入
    http://three20.info/article/2010-10-06-Adding-Three20-To-Your-Project

  • 大小: 504.3 KB
  • 大小: 370.4 KB
  • 大小: 64.5 KB
  • 大小: 446.9 KB
分享到:
评论

相关推荐

    Xcode Treasures: Master the Tools to Design, Build, and Distribute Great Apps

    Find out when to let Xcode handle it automatically, and how to do it manually when needed. Discover how much easier and more fun iOS development is when you know the secrets of the tools. About the ...

    UE(官方下载)

    This is a convenient feature when you're manually comparing files, when you want to copy/paste between multiple files, or when you simply want to divide up your edit space. Tabbed Child Windows ...

    WPF Data Binding with LINQ to SQL

    This is the final part of a three-part series on using LINQ to SQL: Part 1: Mapping Tables to Objects Part 2: Adding/Updating/Deleting Data Part 3: WPF Data Binding with LINQ to SQL These tutorials ...

    A Pathfinding Project Pro v4.2.2.7z

    The A* Pathfinding Project is a powerful and easy to use pathfinding system for Unity. With blazing fast pathfinding your AIs will be able to find the player in complex mazes in no time at all. ...

    Mobile Speech Recognizer 1.2

    After generating Xcode project (keep in mind that you have to use Xcode 8 or higher) you have to add two permissions keys to your project: MOBILE SPEECH RECOGNIZER - UNITY PLUGIN ?3 ...

    Dictionary Learning in Visual Computing

    posed, with some aiming at adding discriminative capability to the dictionary, and some attempt- ing to model the relationship of multiple dictionaries. One prominent application of dictionary ...

    Mesh to Terrain

    快速的将3d软件建立的地形物件转换成Unity的专用地形,强大的转换功能将...• Manually adding models or automatic detection of all models in the layer; • No need to manually add the components of physics.

    SAP PO/PI教程 Process Orchestration The Comprehensive Guide

    SAP Process Orchestration The Comprehensive Guide, 2nd Edition SAP流程编制综合指南 1 Introduction to SAP Process Orchestration 1.1 Historical Overview and Evolution 1.1.1 SAP Process Integration ...

    A Pathfinding Project Prov 4.1.16.zip

    The A* Pathfinding Project is a powerful and easy to use pathfinding system for Unity. With blazing fast pathfinding your AIs will be able to find the player in complex mazes in no time at all. ...

    VB与SAS整合使用

    and SAS and Visual Basic to run a series of SAS reports that can be customized at run time. The system uses a Visual Basic front end program to collect data from the user to customize reports as they ...

    RealThinClientSDK_v610_BETA

    so you will need to do this manually for every XCode Project. And not only once, but every time you recreate XCode Project files by using the 揹pr2xcode?tool, because all your changes will be ...

    cmake4eclipse-2.0.1.zip

    This Eclipse plugin automatically generates build-scripts for the Eclipse CDT ...For instructions inside the Eclipse workbench, go to Help:Help Contents, then open the 'Cmake4eclipse User Guide' node.

    Beginning_Joomla__From_Novice_to_Professional

    page, you’ll be able to make Joomla do almost anything that a manually designed web site can do—and in a fraction of the time. Before we get started, let’s take a quick glance at what makes Joomla ...

    iOS9 Programming Fundamentals with Swift(Swift.Xcode.and.Cocoa.Basics)

    5. **Memory Management**: Swift manages memory automatically, reducing the burden on developers to manually manage memory allocation and deallocation. This automatic management minimizes memory-...

    Getting Started using PC-lint Plus

    This typically involves adding a step to call `lint` with the appropriate options before compiling your code. If using a build system like Jenkins or GitLab CI/CD, create a script or job that runs PC...

    thymeleaf-extras-eclipse-plugin-2.1-master.zip

    To add the Thymeleaf nature to your project: right-click a project >> Thymeleaf >> Add Thymeleaf Nature. Using either method, you should now start getting content assist for any dialect whose ...

    IOS5 Programming Cookbook

    - **Creating a New Project**: To create a new iOS project in Xcode, you need to choose a template (such as a single view application) and provide project details like the product name, organization ...

    mysql-connector-java-8.0.21.jar

    All rights reserved. This is a release of MySQL Connector/J, a JDBC Type 4 driver for MySQL that also supports the new X DevAPI... and "ArtifactId: mysql-connector-java" to your project's pom.xml file.

    Foundations for Analytics with Python O-Reilly-2016-Clinton W. Brownley

    By scheduling your scripts to run on a routine basis, you don’t ever forget to run a script and you can scale beyond what’s possible when you’re running scripts manually on the command line. ...

    Simple application that shows how to use the Data Control to

    Simple application that shows how to use the Data Control to connect to the Biblio.mdb database and display all authors in the Authors table.

Global site tag (gtag.js) - Google Analytics