原文來自IOS教程網,轉載時請注明文章的來源:http://ios.662p.com/thread-1660-1-1.html
NSURLConnectionDataDelegate方法中有:
-(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response{ //This method is called when the server has determined that it //has enough information to create the NSURLResponse. //It can be called multiple times, for example in the case of a //redirect, so each time we reset the data. //receivedData is an instance variable declared elsewhere. NSLog(@"要下載文件大小為 %lld",response.expectedContentLength); [self.receivedData setLength:0];}
復制代碼
大家如果有什么ios開發的問題,可以到ios教程網了解一下。
新聞熱點
疑難解答