画像をダウンロードしていますが、ダウンロードの進行状況を表示したいと考えています。
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:post.url]];
AFHTTPRequestOperation *imageOperation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
imageOperation.responseSerializer = [AFImageResponseSerializer serializer];
[imageOperation setDownloadProgressBlock:^(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead) {
NSLog(@"bytesRead: %d, totalBytesRead: %lld, totalBytesExpected: %lld", bytesRead, totalBytesRead, totalBytesExpectedToRead);
}];
私も完了ブロックを持って[imageOperation start];
います。
ただし、ダウンロードする画像を選択すると、ログに記録されるのは次のとおりです。
bytesRead: 72081、totalBytesRead: 72081、totalBytesExpected: 72081
最後にだけ情報を提供するのはなぜですか?