在没有临时文件的情况下解压缩NSData

问题描述:

我找到了几个库( LiteZip ZipArchive )允许在iPhone上解压缩文件。但是它们都需要输入作为文件。是否有一个库允许直接解压缩包含zip存档数据的NSData而不将其写入临时文件?

我试图采用上面提到的libs,但到目前为止没有成功。

I've found a couple of libs (LiteZip and ZipArchive) that allow to unzip files on iPhone. But both of them require an input as a file. Is there a library that allows to directly unzip NSData containing zip-archived data without writing it to temporary file?
I've tried to adopt mentioned above libs for that, but with no success so far.

此答案这个问题,我指出CocoaDev wiki NSData上的类别,它为该类添加了zip / unzip支持。这可以让你完全在内存中完成。

In this answer to this question, I point out the CocoaDev wiki category on NSData which adds zip / unzip support to that class. This would let you do this entirely in memory.