Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Switching to AFNetworking from ASIHTTPRequest - Issue with ASINetworkQueue

I'm working on a problem where I have to download around 10 different large files in a queue, and I need to display a progress bar indicating the status of the total transfer. I have this working just fine with ASIHTTPRequest in iOS4, but I'm trying to transition to AFNetworking since ASIHTTPRequest has issues in iOS5 and is no longer maintained.

I know you can report progress on individual requests using AFHTTPRequestOperation's downloadProgressBlock, but I can't seem to find a way to report overall progress of multiple requests that would be executed on the same NSOperationQueue.

Any suggestions? Thanks!

like image 236
BBonifield Avatar asked Nov 08 '11 20:11

BBonifield


1 Answers

[operation setUploadProgressBlock:^(NSInteger bytesWritten, NSInteger totalBytesWritten, NSInteger totalBytesExpectedToWrite) {
    NSLog(@"Sent %d of %d bytes", totalBytesWritten, totalBytesExpectedToWrite);
}];

Operation is AFHTTPRequestOperation

like image 133
Melvin Avatar answered Oct 19 '22 20:10

Melvin