ドキュメント ディレクトリに保存されているファイル (ZipSecretExcel.zip) をダウンロードしました。次のコードを使用して、ZipArchieve を使用してドキュメント ディレクトリでこのファイルを解凍しようとしています。
NSString *documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *zipFilePath = [documentsDirectory stringByAppendingPathComponent:@"ZippSecretExcel.zip"];
NSString *output = [documentsDirectory stringByAppendingPathComponent:@"UnZipSecret"];
ZipArchive* za = [[ZipArchive alloc] init];
if( [za UnzipOpenFile:zipFilePath] ) {
if( [za UnzipFileTo:output overWrite:YES] != NO ) {
//unzip data success
//do something
//NSLog(@"Folder successfully zipped");
}
[za UnzipCloseFile];
}
ただし、フォルダの圧縮に成功したというログ メッセージは出力されません。これは、解凍に失敗したことを意味します。私が間違っていることは誰にもわかりますか?