xcode4中配置Three20開發環境

來源:互聯網
上載者:User

大名鼎鼎的Three20想必大家都聽說過,很多APP都是用它開發的,開發UI很方便,功能也很強大,用它就不必深究枯燥的iOS SDK。今天介紹一下如何在xcode4中配置環境支援Three20開發。

1。首先我們得去把源碼下載下來。網址在:https://github.com/facebook/three20 解壓放在我們工程目錄下。

2。在解壓目錄下src/Three20下的Three20.xcodeproj拖到自己的工程裡,在彈出的對話方塊中Destination欄“Copy Items into destination group's folder”不要選中,Addto targets欄中選中自己的工程target,並不是unit
test target,然後點Finish.

3。在工程中展開Three20,你會發現有一個group叫Dependencies,展開它,下面有六個依賴工程,選中它們,並拖到自己的工程中去。

4。將src目錄下的Three20.bundle拖到自己的工程中去。

5。加入需要的靜態庫。如紅色部份是加入的:


6。加入需要的目標依賴項。如:


7。加入Quartz.framework

8。在工程配置頁,build裡Header Search Paths裡加入

$(BUILT_PRODUCTS_DIR)/../three20" "

$(BUILT_PRODUCTS_DIR)/../../three20" "

$(CONFIGURATION_BUILD_DIR)/../../three20"

如:


9。在Other
Linker Flags裡加入 -ObjC -all_load


10。然後在需要用Three20的檔案中引入標頭檔#import
"Three20/Three20.h" 就可以用Three20的功能了。


還有一種方法就是利用指令碼,在src目錄下面有一個script目錄,開啟terminal進入到script目錄下,然後運行命令:

python ttmodule.py -p path/to/your/project/yourproject.xcodeproj Three20 --xcode-version=4

-p後面是你工程的絕對路徑,當然也可是當前script的相對路徑。

這樣就自動完成第一種方法中的各種配置。


這兒有一些Three20的教程,example目錄下也有不少demo工程

  • Three20
    Stylesheets iPhone Tutorial
  • Three20
    Custom Cells iPhone Tutorial
  • Three20
    Table Item Tutorial
  • http://www.codeios.com/thread-598-1-1.html
  • http://iosguy.com/2010/10/19/tthree20-a-brief-ttlauncherview-tutorial/
  •  http://three20.pypt.lt/start

    http://three20.pypt.lt/starthttp://three20.pypt.lt/start

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    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.