Three20学习添加到xCode

1、从 https://github.com/facebook/three20 下载最新的Three20库

  这里面包含了源码及简单的官方示例。



2、打开自己的工程,或是新建一个工程,将上面获取的Three20库解压后,找到src文件夹,将它拷贝到工程的根目录下。

(我把src改名为three20_src,为了与以后工程内的文件夹作区别)



3、打开终端,进入到工程所在文件夹路径,然后输入:python three20_src/scripts/ttmodule.py -p /Users/i3039/MyApps/ByThree20/MyThree20Test/MyThree20Test.xcodeproj Three20 --xcode-version=4 

(官方示例为:python three20/src/scripts/ttmodule.py -p path/to/myProject.xcodeproj:myTargetName Three20。)

这样,Three20库就已经安装进工程里了,再不需要做别的操作,查看工程后,你会发现在Supporting Files下多了个Three20.bundle,在Frameworks下也引入了Three20库的子项目


4、先Bulid一下工程,检查一下Bulid文件夹里是否增加了Three20的文件夹,如果没有,则安装未成功。


5、开始使用Three20

打开文件 MyThree20Test-Prefix.pch,加入 #import <Three20/Three20.h>,再Build一下,如果无错误提示,则表示安装完全成功,可以开始使用了。

一定要先Build一次再加入 #import <Three20/Three20.h>,否则的话,会出现找不到three20.h文件的提示



2)添加extThree20XML模块

1
python three20/src/scripts/ttmodule.py -p path/to/myProject.xcodeproj extThree20XML

同时修改项目的Prefix.pch文件如下

1
2
3
4
5
6
#ifdef __OBJC__
    #import <Foundation/Foundation.h>
    #import <UIKit/UIKit.h>
    #import “Three20Network/Three20Network.h”
    #import “extThree20XML/extThree20XML.h”
#endif

3)添加extThree20JSON模块

1
python three20/src/scripts/ttmodule.py -p path/to/myProject.xcodeproj extThree20JSON:extThree20JSON+YAJL

同时修改项目的Prefix.pch文件

Objective-C
1
2
3
4
5
6
#ifdef __OBJC__
    #import <Foundation/Foundation.h>
    #import <UIKit/UIKit.h>
    #import “Three20Network/Three20Network.h”
    #import “extThree20JSON/extThree20JSON.h”
#endif


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值