本文介绍了在iOS中提取zlib文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
从使用zlib压缩的服务器下载数据时,我想知道需要执行哪些步骤来解压缩并保存到核心数据
When downloading data from a server thats compressed using zlib, I was wondering what steps are needed to take to uncompress and save to core data
任何帮助都会非常赞美
推荐答案
使用类似从网络检索文件。这可以处理gzip,这可能是来自网络的数据被压缩。
Use something like ASIHTTP to retrieve the file off the network. That can handle gzip which is likely what the data coming off the network is compressed with.
如果您希望自行滚动,请查看此对NSData:在我以前工作得很好,可能会做你需要的。
If you'd prefer to roll your own, take a look at this zlib category on NSData: Has worked well for me in the past and likely does what you'll need.
您还需要将-lz添加到其他链接器标志构建设置
You'll also need to add -lz to the "other linker flags" build setting
这篇关于在iOS中提取zlib文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!