項(xiàng)目中赤赊,因?yàn)殡S時(shí)需要更新數(shù)據(jù)包(不可能發(fā)布一等到發(fā)布下一個(gè)版本)托启,好比我自己的項(xiàng)目中洽沟,就包含了,HTML和一些資源文件來實(shí)現(xiàn)本地化存儲坦弟。只要根據(jù)資源包的時(shí)間或版本(自定義的版本)來進(jìn)行更新护锤。
ZipArchive is a simple utility class for zipping and unzipping files on iOS and Mac.
簡介
- 解壓zip文件
- 解壓帶有密碼保護(hù)的zip文件
- 創(chuàng)建zip文件
- 對存在的zip文件進(jìn)行追加文件
- Zip files (沒看懂)
- Zip-up NSData instances. (with a filename) NSData實(shí)體類壓縮?
準(zhǔn)備
- 拷貝 SSZipArchive 和minizip 文件至項(xiàng)目中
- 添加 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)