iOS开发笔记

iOS之ZipArchive解压zip文件

2017-03-04  本文已影响1297人  younger_times

项目中,因为随时需要更新数据包(不可能发布一等到发布下一个版本),好比我自己的项目中,就包含了,HTML和一些资源文件来实现本地化存储。只要根据资源包的时间或版本(自定义的版本)来进行更新。

github-ZipArchive
参考博客

ZipArchive is a simple utility class for zipping and unzipping files on iOS and Mac.

简介

准备

  1. 拷贝 SSZipArchive 和minizip 文件至项目中
  2. 添加 libz 库
  3. 它是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)

错误:

上一篇 下一篇

猜你喜欢

热点阅读