iOS边练边学--文件压缩和解压缩的第三方框架SSZipArchive的简单使用

一、非cocoaPods方法,需要注意的是:直接将SSZipArchive拖入项目编译会报错。

Undefined symbols for architecture x86_64:

  "_crc32", referenced from:

      _unzReadCurrentFile in unzip.o

      _zipWriteInFileInZip in zip.o

  "_deflate", referenced from:

      _zipWriteInFileInZip in zip.o

      _zipCloseFileInZipRaw64 in zip.o

  "_deflateEnd", referenced from:

      _zipCloseFileInZipRaw64 in zip.o

  "_deflateInit2_", referenced from:

      _zipOpenNewFileInZip4_64 in zip.o

  "_get_crc_table", referenced from:

      _unzOpenCurrentFile3 in unzip.o

      _zipOpenNewFileInZip4_64 in zip.o

  "_inflate", referenced from:

      _unzReadCurrentFile in unzip.o

  "_inflateEnd", referenced from:

      _unzCloseCurrentFile in unzip.o

  "_inflateInit2_", referenced from:

      _unzOpenCurrentFile3 in unzip.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

将框架拖入项目,还需要引入另一个资源包。如图:

二、利用cocoaPods导入的SSZipArchive则不需要导入任何资源包,因为系统已经帮我们做好了。代码示例:

原文地址:https://www.cnblogs.com/gchlcc/p/5440209.html