IOS IPhone 开发需要的开源库[编辑中.. 不断更新]
2013-12-25 13:21
375 查看
目录[-]
前言
1:IOS &IPhone 网络异步加载 asi-http-request
【1-1 ASI HTTP 下载地址】
【1-2 注意事项】
【1-3 小试牛刀】
2:解析JSON数据 SBJSON
【 2-1 SBJSON 下载地址】
【2-2 注意事项】
【2-3 小试牛刀】
3:加载网络数据的时候 显示onLoading动画图片 MBProgressHUD
【3-1 MBProgressHUD 下载地址】
【3-2 注意事项】
【3-3 小试牛刀】
4:IOS &IPhone 异步图片加载 EGOImageLoadding
【EGOImageLoadding 下载地址】
【小试牛刀】
5:上拉刷新,下拉翻页
【5-1 EGOTableViewPullRefresh 下载地址】
6:左边菜单导航
前言
我是 java & php 程序员,遇到了坑爹的iPhone,被逼无奈在崩溃的边缘下学习object-c ,在学习中遇到了很多 奇葩,无知,龌蹉,呕吐的问题(弱弱的说 : 有的些问题到现在还不知道具体的原理)故此把开发中所有遇到的问题,和需要使用的开源库 一一记载下来,为那些苦B的要学习OBJECT-C的屌丝们加点料吧。本文纯粹记录性游记类文章,学术性观摩团请绕行,专家请绕行。在编写过程中避免不了出现问题或者遗漏问题,希望大家多多指点与板砖!
在 Build Phases中添加相应的Link Binary With Libraries
1.MobileCoreServices.framework
2.SystemConfiguration.framework
3.CFNetwork.framework
4.Libz.dylib
由于ARC Restrictions导致的祖国山河一片红
选中相关文件 回车后输入命令:-fno-objc-arc
更详细的使用方法请参照:http://www.cnblogs.com/zhwl/archive/2012/07/14/2591752.html
【5-2 注意事项】
需要在Link Binary with Libraries中加QuartzCore.framework Foundation.framework CoreGraphics.framework 以及 [1-2 中的注意事项]
前言
1:IOS &IPhone 网络异步加载 asi-http-request
【1-1 ASI HTTP 下载地址】
【1-2 注意事项】
【1-3 小试牛刀】
2:解析JSON数据 SBJSON
【 2-1 SBJSON 下载地址】
【2-2 注意事项】
【2-3 小试牛刀】
3:加载网络数据的时候 显示onLoading动画图片 MBProgressHUD
【3-1 MBProgressHUD 下载地址】
【3-2 注意事项】
【3-3 小试牛刀】
4:IOS &IPhone 异步图片加载 EGOImageLoadding
【EGOImageLoadding 下载地址】
【小试牛刀】
5:上拉刷新,下拉翻页
【5-1 EGOTableViewPullRefresh 下载地址】
6:左边菜单导航
前言
我是 java & php 程序员,遇到了坑爹的iPhone,被逼无奈在崩溃的边缘下学习object-c ,在学习中遇到了很多 奇葩,无知,龌蹉,呕吐的问题(弱弱的说 : 有的些问题到现在还不知道具体的原理)故此把开发中所有遇到的问题,和需要使用的开源库 一一记载下来,为那些苦B的要学习OBJECT-C的屌丝们加点料吧。本文纯粹记录性游记类文章,学术性观摩团请绕行,专家请绕行。在编写过程中避免不了出现问题或者遗漏问题,希望大家多多指点与板砖!1:IOS &IPhone 网络异步加载 asi-http-request
【1-1 ASI HTTP 下载地址】
https://github.com/pokeb/asi-http-request【1-2 注意事项】
下载asi-http-request-master后解压,把\Classes文件下所有文件,\External\Reachability 文件夹下所有文件添加到你的工程中。在 Build Phases中添加相应的Link Binary With Libraries
1.MobileCoreServices.framework
2.SystemConfiguration.framework
3.CFNetwork.framework
4.Libz.dylib
由于ARC Restrictions导致的祖国山河一片红
选中相关文件 回车后输入命令:-fno-objc-arc
【1-3 小试牛刀】
引入头文件 #import "ASIHTTPRequest.h"更详细的使用方法请参照:http://www.cnblogs.com/zhwl/archive/2012/07/14/2591752.html
01 | - ( void )viewDidLoad { |
02 | [super viewDidLoad]; |
03 | //请求的后台活动列表 |
04 | NSURL *url = [NSURL URLWithString:@ "http://m.weather.com.cn/data/101180701.html" ]; |
05 | ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; |
06 | [request setDelegate:self]; |
07 | [request startAsynchronous]; |
08 |
09 | } |
10 |
11 | //异步请求开始 |
12 | - ( void )requestStarted:(ASIHTTPRequest *)request { |
13 | NSLog(@ "request start :%@" , @ "start" ); |
14 | } |
15 | //异步请求结束 |
16 | - ( void )requestFinished:(ASIHTTPRequest *)request { |
17 | // Use when fetching text data |
18 | NSString *jsonString = [request responseString]; |
19 | NSLog (@ "Response JSON :%@" , jsonString); |
20 | } |
21 | //异步请求错误 |
22 | - ( void )requestFailed:(ASIHTTPRequest *)request { |
23 | // NSError *error = [request error]; |
24 | NSLog (@ "Response JSON :%@" , @ "error" ); |
25 | } |
2:解析JSON数据 SBJSON
【 2-1 SBJSON 下载地址】
https://github.com/stig/json-framework【2-2 注意事项】
解压后把相应的文件导入到工程中,尚未发现问题【2-3 小试牛刀】
在1-3的小试牛刀中,我们请求了有关天气的URL,这个URL会有一个JSON的相应,我们继续1-3,来解解析这个响应的JSON01 | - ( void )viewDidLoad { |
02 | [super viewDidLoad]; |
03 | //请求的后台活动列表 |
04 | //NSURL *url = [NSURL URLWithString:@"http://192.168.1.4/beer/?cat=2&json=1"]; |
05 |
06 | NSURL *url = [NSURL URLWithString:@ "http://m.weather.com.cn/data/101180701.html" ]; |
07 | ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; |
08 | [request setDelegate:self]; |
09 | [request startAsynchronous]; |
10 |
11 | } |
12 |
13 | //异步请求开始 |
14 | - ( void )requestStarted:(ASIHTTPRequest *)request { |
15 | NSLog(@ "request start :%@" , @ "start" ); |
16 | } |
17 | //异步请求结束 |
18 | - ( void )requestFinished:(ASIHTTPRequest *)request { |
19 | NSString *jsonString = [request responseString]; |
20 | NSLog (@ "Response JSON :%@" , jsonString); |
21 | SBJsonParser *parser =[[SBJsonParser alloc] init]; |
22 | NSDictionary *rootDic = [parser objectWithString:jsonString]; |
23 | NSDictionary *weatherInfo = [rootDic objectForKey:@ "weatherinfo" ]; |
24 | NSLog (@ "Response JSON city :%@" , [weatherInfo objectForKey:@ "city" ]); |
25 | } |
26 | //异步请求错误 |
27 | - ( void )requestFailed:(ASIHTTPRequest *)request { |
28 | // NSError *error = [request error]; |
29 | NSLog (@ "Response JSON :%@" , @ "error" ); |
30 | } |
3:加载网络数据的时候 显示onLoading动画图片 MBProgressHUD
【3-1 MBProgressHUD 下载地址】
https://github.com/jdg/MBProgressHUD【3-2 注意事项】
下载后导入MBProgressHUD.h MBProgressHUD.m 暂时没有发现恶心的问题【3-3 小试牛刀】
导入头文件 MBProgressHUD.h,继续2-3小试牛刀 ,2-3中我们异步读取天气信息,所以我们需要在请求前显示加载动画,在请求结束,或网络出现问题时 我们需要关闭动画01 | - ( void )viewDidLoad { |
02 | [super viewDidLoad]; |
03 | //请求的后台活动列表 |
04 |
05 | NSURL *url = [NSURL URLWithString:@ "http://m.weather.com.cn/data/101180701.html" ]; |
06 | ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; |
07 | [request setDelegate:self]; |
08 | [request startAsynchronous]; |
09 |
10 | } |
11 |
12 | //异步请求开始 |
13 | - ( void )requestStarted:(ASIHTTPRequest *)request { |
14 | NSLog(@ "request start :%@" , @ "start" ); |
15 | [MBProgressHUD showHUDAddedTo:self.view animated:YES]; |
16 | } |
17 | //异步请求结束 |
18 | - ( void )requestFinished:(ASIHTTPRequest *)request { |
19 | [MBProgressHUD hideHUDForView:self.view animated:YES]; |
20 | NSString *jsonString = [request responseString]; |
21 | NSLog (@ "Response JSON :%@" , jsonString); |
22 | SBJsonParser *parser =[[SBJsonParser alloc] init]; |
23 | NSDictionary *rootDic = [parser objectWithString:jsonString]; |
24 | NSDictionary *weatherInfo = [rootDic objectForKey:@ "weatherinfo" ]; |
25 | NSLog (@ "Response JSON city :%@" , [weatherInfo objectForKey:@ "city" ]); |
26 | } |
27 | //异步请求错误 |
28 | - ( void )requestFailed:(ASIHTTPRequest *)request { |
29 | // NSError *error = [request error]; |
30 | NSLog (@ "Response JSON :%@" , @ "error" ); |
31 | [MBProgressHUD hideHUDForView:self.view animated:YES]; |
32 | } |
4:IOS &IPhone 异步图片加载 EGOImageLoadding
【EGOImageLoadding 下载地址】
https://github.com/enormego/EGOImageLoading【小试牛刀】
5:上拉刷新,下拉翻页
【5-1 EGOTableViewPullRefresh 下载地址】
https://github.com/enormego/EGOTableViewPullRefresh【5-2 注意事项】
需要在Link Binary with Libraries中加QuartzCore.framework Foundation.framework CoreGraphics.framework 以及 [1-2 中的注意事项]
6:左边菜单导航
ECSlidingViewController-master :https://github.com/edgecase/ECSlidingViewController相关文章推荐
- 峰回路转,Firefox 浏览器即将重返 iOS 平台
- 介绍一款信息管理系统的开源框架---jeecg
- 峰回路转,Firefox 浏览器即将重返 iOS 平台
- 专家解读:开源软件项目是否会被限制出口?
- 开发人员、程序员与计算机科学家三者之间的区别
- 专家解读:开源软件项目是否会被限制出口?
- [转][源代码]Comex公布JailbreakMe 3.0源代码
- fuse-dfs的设定手册
- Centos下***(pptpd)的部署
- 程序员必备,程序员四大忌
- 程序员们,做好你手里的俩份试卷
- 程序员必备的10大健康装备! 我们要工作更要健康!
- 修复mysql数据库
- 一篇关于程序员性格的文章第1/3页
- 程序员编程从初级到中级的10个秘诀
- 桌面中心(一)创建数据库
- 五个PHP程序员工具
- PHP 程序员应该使用的10个组件
- 国外比较好的几个的Php开源建站平台小结
- 腾讯QQ php程序员面试题目整理