Adding Three20 to your Xcode project

  1. Get the code
    1. Clone the three20 git reposito ry: git clone git://github.com/facebook/three20 .git
  2. Add the library to the project
    1. Drag Three20 .xcodeproj from src/Three20 / into your project .
    2. Select the Three20 .xcodeproj item in Xcode that you just created and look at the "Detail" tab.
    3. Ensure that the checkbox beside libThree20 .a is checked. If not, check it.
      • Alternatively, you can expand the Three20 project and drag libThree20 .a to your target's "Link Binary With Libraries" action.
  3. Make the library a dependency
    1. In Xcode's app menu, click Project ⇒ Edit Active Target.
    2. Click the "General" tab.
    3. Click the plus butto n below "Direct Dependencies" and add Three20 .
    4. Click the "Build" tab.
    5. Add ../three20 /Build/Products/three20 to "Header Search Paths".
      • Note: Change the relative path (../ ) accordingly.
    6. 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.
  4. Add the resource bundle
    1. Locate Three20 .bundle under three20 /src and drag and drop it into your project .
    2. 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 ".
  5. Add the Core Animation framework
    1. Right click on the "Frameworks" group in your project (or equivalent) and select Add ⇒ Existing Frameworks.
    2. Then locate QuartzCore.framework and add it to the project .
  6. Done!
    • Do #import <Three20 /Three20 .h> anywhere you want to use Three20 classes in your project .
發佈了149 篇原創文章 · 獲贊 26 · 訪問量 22萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章