【Three20】手动添加Three20(XCode 4.6)
github:https://github.com/facebook/three20
官方网站:http://three20.info
参考:http://chepri.com/visual-guide-manually-adding-three20-xcode-4-project/
1、添加Three20.xcodeproj
“add Files to”,在three20/src/Three20目录下,选择Three20.xcodeproj,在弹出的对话框中,请保证反选“Copy items into destination group's folder”选项,点击“add”按钮添加
2、添加其它依赖.xcdeproj项目
打开Three20.xcodeproj,展开Dependencies group,看到以下.xcodeproj项目文件
- Three20Core.xcodeproj
- Three20Network.xcodeproj
- Three20Style.xcodeproj
- Three20UICommon.xcodeproj
- Three20UINavigator.xcodeproj
- Three20UI.xcodeproj
全部选中,拖拽到项目中
3、连接Three20静态库
Targests -> Build Phases -> Link Binary With Libraries
添加静态库:
- Three20.a
- Three20Core.a
- Three20Network.a
- Three20Style.a
- Three20UICommon.a
- Three20UINavigator.a
- Three20UI.a
4、添加依赖
Targests -> Build Phases -> Target Dependencies
添加依赖项:
- Three20
- Three20Core
- Three20Network
- Three20Style
- Three20UICommon
- Three20UINavigator
- Three20UI
5、添加bundle文件
“add Files to”,在three20/src目录下,选择Three20.bundle,在弹出的对话框中,请保证反选“Copy items into destination group's folder”选项,点击“add”按钮添加
6、添加framework
Targests -> Build Phases -> Link Binary With Libraries
添加QuartzCore.framework
7、设置Three20头文件搜索目录
Targets -> Build Settings -> Search Paths -> User Header Search Paths
添加如下内容(注意:带双引号):
"$(BUILT_PRODUCTS_DIR)/../three20"
"$(BUILT_PRODUCTS_DIR)/http://www.cnblogs.com/three20"
Targets -> Build Settings -> Search Paths -> Header Search Paths
添加如下内容:
./three20/Build/Products/three20
8、设置Other Linker Flags
Targets -> Build Settings -> Linking -> Other Linker Flags
添加如下内容:
-ObjC
-all_load
编译,UIViewAdditions.h和UIViewAdditions.m报错!!!
解决方案:
将 #ifdef DEBUG 修改为 #ifdef DEBUG_TOUCHES
参考:
1、http://www.xuanyusong.com/archives/1818
2、https://github.com/cogenta/three20-1.0.5/commit/be70e1ff3965c0ff4f7598bf5213349629a27540
使用:
导入头文件
#import "Three20/Three20.h"
iOS 开发讨论群:82873648
![知识共享许可协议](http://i.creativecommons.org/l/by-nc/3.0/88x31.png)
本作品采用知识共享署名-非商业性使用 3.0 许可协议进行许可。
转载请署名李震(博客地址:http://www.cnblogs.com/dyingbleed/),且不得用于商业目的。
博客园博客已停止更新,博客地址:dyingbleed.com