gpt4 book ai didi

cocoa - ZipZAP 解压缩 ZIP 文件

转载 作者:行者123 更新时间:2023-12-03 17:55:50 25 4
gpt4 key购买 nike

我需要将 ZIP 文件的内容解压缩到选定的目录中。我确实做了:

ZZArchive* archive = [ZZArchive archiveWithContentsOfURL:[NSURL fileURLWithPath:@:"blahblah.zip"]];
for (NSUInteger index = 0, count = archive.entries.count; index < count; ++index)
{
ZZArchiveEntry* archiveEntry = archive.entries[index];
NSString *inZipFileName = nextEntry.fileName;
}

但是如何将 archiveEntry 解压缩到文件名 inZipFileName 中呢?

最佳答案

最后,很简单:

NSData *data = [nextEntry data];
[data writeToFile:@"uncompressed_filename" atomically:NO];

维尼,维迪,维西......

关于cocoa - ZipZAP 解压缩 ZIP 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13707236/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com