2014年10月24日

摘要: ASI和AFN有什么区别1.性能(重点)* ASI基于底层的CFNetwork框架* AFN基于NSURLConnection* 运行性能: ASI > ASN2.处理服务器数据1> AFN : 根据服务器返回数据的数据, 进行自动解析* 服务器返回的是JSON数据, 自动转换为NSDictiona... 阅读全文
posted @ 2014-10-24 15:32 林源 阅读(352) 评论(0) 推荐(0) 编辑
摘要: 1.Reachability// 监听网络状态改变的通知[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkStateChange) name:kReachabilityChangedNot... 阅读全文
posted @ 2014-10-24 15:31 林源 阅读(1231) 评论(0) 推荐(0) 编辑
摘要: 1 五.AFN 2 1.GET\POST 3 1> GET请求 4 // 1.获得请求管理者 5 AFHTTPRequestOperationManager *mgr = [AFHTTPRequestOperationManager manager]; 6 7 // 2.封装请求参数 8 NSM... 阅读全文
posted @ 2014-10-24 15:29 林源 阅读(953) 评论(0) 推荐(0) 编辑
摘要: 1 一NSURLCache 2 缓存的使用步骤 3 // 获得全局的缓存对象 4 NSURLCache *cache = [NSURLCache sharedURLCache]; 5 6 // 设置缓存容量 7 cache.memoryCapacity = 1024 * 1024;... 阅读全文
posted @ 2014-10-24 15:25 林源 阅读(383) 评论(0) 推荐(0) 编辑
摘要: 1 一、NSURLConnection 2 1.发送请求 3 1> 发送一个同步请求 4 + (NSData *)sendSynchronousRequest:(NSURLRequest *)request returningResponse:(NSURLResponse **)response ... 阅读全文
posted @ 2014-10-24 15:23 林源 阅读(205) 评论(0) 推荐(0) 编辑

导航