yyh123
 1 实现NSURLConnectionDataDelegate的代理方法
 2 - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
 3     NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response;
 4     
 5     if([httpResponse respondsToSelector:@selector(allHeaderFields)]){
 6         NSDictionary *fields = [httpResponse allHeaderFields];
 7         int totalSize = [[fields objectForKey:@"Content-Length"]             intValue];
 8     }
 9 }
10 
11 totalSize就是文件的长度

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-05
  • 2022-12-23
  • 2021-10-19
  • 2022-01-18
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
  • 2021-09-30
  • 2022-02-07
  • 2021-08-22
相关资源
相似解决方案