0
作爲標題,我正在處理使用AFNetworking 2.5.4框架下載大型壓縮文件時,用戶意外退出應用程序的情況。我想知道是否有必要手動清除AFNetworking生成的Incomplete文件夾(<app_name>/tmp/Incomplete
),因爲zip文件的下載量非常大。如果iOS發現文件夾大小增加,它會處理這個文件夾嗎?是否需要手動清除AFNetworking生成的Incomplete文件夾?
P.S.我下載的邏輯是通過使用NSOperationQueue
及以下AFDownloadRequestOperation
:
- (AFDownloadRequestOperation *)operation
{
if (_operation) {
return _operation;
}
_operation = [[AFDownloadRequestOperation alloc] initWithRequest:self.downloadRequest
targetPath:self.targetPath
shouldResume:YES];
#ifdef DEBUG
_operation.securityPolicy.allowInvalidCertificates = YES;
#endif
[_operation setProgressiveDownloadProgressBlock:self.progressBlock];
[_operation setCompletionBlockWithSuccess:self.completionBlock
failure:self.failureBlock];
_operation.deleteTempFileOnCancel = YES;
return _operation;
}
是這樣意味着我需要手動處理它?那就是當下載發現設備中沒有足夠的空間時,iOS是否會清除'tmp'文件夾? –
我想如果你不能刪除文件,然後iphone處理它。 **當需要更多空間時,會自動刪除緩存的文件**請參閱此[鏈接](https://support.apple.com/zh-cn/HT201656) – viratpuar
從上一個[link](https://support.apple .com/zh-cn/HT201656),_如果要從iOS設備中刪除緩存文件 當您的iOS設備需要更多空間時,會自動刪除緩存文件。你不需要自己刪除它們。任何人都可以提供更多的細節嗎? –