项目中,因为随时需要更新数据包(不可能发布一等到发布下一个版本),好比我自己的项目中,就包含了,HTML和一些资源文件来实现本地化存储。只要根据资源包的时间或版本(自定义的版本)来进行更新。
ZipArchive is a simple utility class for zipping and unzipping files on iOS and Mac.
简介
- 解压zip文件
- 解压带有密码保护的zip文件
- 创建zip文件
- 对存在的zip文件进行追加文件
- Zip files (没看懂)
- Zip-up NSData instances. (with a filename) NSData实体类压缩?
准备
- 拷贝 SSZipArchive 和minizip 文件至项目中
- 添加 libz 库
- 它是ARC
使用 (Object-c)
// Create[SSZipArchive createZipFileAtPath: zipPath withContentsOfDirectory: sampleDataPath];// Unzip[SSZipArchive unzipFileAtPath:zipPath toDestination: unzipPath];
Swift
// CreateSSZipArchive.createZipFileAtPath(zipPath, withContentsOfDirectory: sampleDataPath)// UnzipSSZipArchive.unzipFileAtPath(zipPath, toDestination: unzipPath)