I\'ve recently updated to AFNetworking 2.0. The documentation said it is compatible with iOS6.0+. I am building a iOS 6.0 app, when I am trying to implement a download metho
try this...
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.responseSerializer = [AFHTTPResponseSerializer serializer];
AFHTTPRequestOperation *operation = [manager GET:urlString
parameters:nil
success:^(AFHTTPRequestOperation *operation, NSData *responseData)
{
[responseData writeToURL:someLocalURL atomically:YES];
}
failure:^(AFHTTPRequestOperation *operation, NSError *error)
{
NSLog(@"Downloading error: %@", error);
}];
[operation setDownloadProgressBlock:^(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead)
{
float downloadPercentage = (float)totalBytesRead/(float)(totalBytesExpectedToRead);
[someProgressView setProgress:downloadPercentage animated:YES];
}];