무언가를 다운로드하려면 [manager downloadTaskWithRequest:request progress:&progress destination:^NSURL *(NSURL *targetPath, NSURLResponse *response){}]
을 사용합니다.NSProgress가 완료되면 파일을 읽을 수 없습니까?
KVO를 사용하여 progress.fractionCompleted == 1 일 때 다운로드 한 파일을 읽었습니다. 그리고 나는 파일을 읽을 때 이 아닌을 얻게됩니다.
그래서 을 알고 싶습니다. 파일을 읽을 수 있습니다. 그리고 진행 완료 의미 디스크에 파일을 완전히 작성 또는 모든 데이터을받습니다.
그래서 편집
- (void)URLSession:(__unused NSURLSession *)session
downloadTask:(__unused NSURLSessionDownloadTask *)downloadTask
didWriteData:(__unused int64_t)bytesWritten
totalBytesWritten:(int64_t)totalBytesWritten
totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite
{
self.progress.totalUnitCount = totalBytesExpectedToWrite;
self.progress.completedUnitCount = totalBytesWritten;
}
, 그것은 진행 상황을 설정 한 후 첫 번째 파일을 작성해야 하는가? 하지만 왜 내가 nil 얻을 ???
대단히 감사합니다. – Tepmnthar