,__func__,[NSThread currentThread]); self.data = [NSMutableData data]; //在该办法中须要经由过程completionHandler回调告诉体系应当若何处理办事器返回的数据 completionHandler(NSURLSessionResponseAllow); } //接收到二进制数据(如不雅数据量大年夜会调用多次) - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data { NSLog(@"%s-----%@",__func__,[NSThread currentThread]); //拼接数据 [self.data appendData:data]; } //完成或者掉败的时刻调用 - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error { NSLog(@"%s------%@",__func__,[[NSString alloc] initWithData:self.data encoding:NSUTF8StringEncoding]); NSLog(@"%@",[NSThread currentThread]); } 【编辑推荐】
- iOS下若何一键调试Push
- iOS开辟中常见bug!(内附解答办法)
- 平易近间高手帮苹不雅搞设计:若何让iOS 11的通知栏更好用?
- iOS法度榜样员的Ruby初体验
- iOS不如许写简历,都找不到工作了
【义务编辑:未丽燕 TEL:(010)68476606】
推荐阅读
2018边缘数据中心关键之年!
沙龙晃荡 | 3月31日 京东、微博、华为拭魅战专家与你合营商量容器技巧实践!
所谓边沿数据中间,指的就是:处于>>>详细阅读
本文标题:iOS开发3年只用5分钟搞定面试官
地址:http://www.17bianji.com/lsqh/40950.html
1/2 1