美文网首页iOS开发笔记
iOS之ZipArchive解压zip文件

iOS之ZipArchive解压zip文件

作者: younger_times | 来源:发表于2017-03-04 17:22 被阅读1297次

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

    github-ZipArchive
    参考博客

    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实体类压缩?

    准备

    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)
    
    

    错误:

    相关文章

      网友评论

        本文标题:iOS之ZipArchive解压zip文件

        本文链接:https://www.haomeiwen.com/subject/yqjjgttx.html