2014-05-14 6 views

Répondre

0

Utilisez NSURLSessionDownloadTask et mettre en œuvre est délégué

-(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); 
} 

tutoriel complet se trouve ici: http://www.raywenderlich.com/51127/nsurlsession-tutorial

Questions connexes