2014-05-14 85 views

回答

0

使用NSURLSessionDownloadTask和实现它的委托

-(void)URLSession:(NSURLSession *)session 
    downloadTask:(NSURLSessionDownloadTask *)downloadTask 
    didWriteData:(int64_t)bytesWritten 
totalBytesWritten:(int64_t)totalBytesWritten 
totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite 
{ 
    NSLog(@"%f/%f", (double)totalBytesWritten, 
    (double)totalBytesExpectedToWrite); 
} 

完整的教程可以在这里找到:http://www.raywenderlich.com/51127/nsurlsession-tutorial