我需要将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?
答案 0 :(得分:1)
最后,这很简单:
NSData *data = [nextEntry data];
[data writeToFile:@"uncompressed_filename" atomically:NO];
Veni,vidi,vici ......