ZipZAP解压缩ZIP文件

时间:2012-12-04 16:20:35

标签: cocoa unzip zipzap

我需要将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?

1 个答案:

答案 0 :(得分:1)

最后,这很简单:

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

Veni,vidi,vici ......