简体   繁体   English

如何从一个NSData对象写入多个文件?

[英]How to write multiple files from one NSData object?

I'm writing an iPhone app that includes in-app purchasing. 我正在编写一个包含应用程序内购买的iPhone应用程序。 It downloads a zip file, then I unzip the file using the popular NSData category (zlibDeflate) which outputs the uncompressed file into an NSData object. 它下载一个zip文件,然后我使用流行的NSData类别(zlibDeflate)解压缩该文件,该类别将未压缩的文件输出到NSData对象中。 The zip file contains multiple files in it which I need to write to the Documents directory. zip文件中包含多个文件,我需要将这些文件写入Documents目录。 How can I write each file separately from this one NSData object? 如何从这一个NSData对象中单独编写每个文件? writeToFile just writes the whole thing to one file. writeToFile只是将整个事情写入一个文件。

Thank you and let me know if you need any more information. 感谢您,如果您需要更多信息,请告诉我们。

If you still haven't fixed this, you could try and use: 如果您还没有修复此问题,可以尝试使用:

http://code.google.com/p/ziparchive/ http://code.google.com/p/ziparchive/

and read the comments to the documentation here: 并阅读以下文档中的注释:

http://code.google.com/p/ziparchive/wiki/PageName http://code.google.com/p/ziparchive/wiki/PageName

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM