配置SSZipArchive

导入SSZipArchive后,先编译,会出现如下错误:


iOS SSZipArchive--压缩与解压缩
异常.png

解决方法:
单击项目->Linked Frameworks and Libraries->点击左下角加号->输入libz.tbd->Add,再次编译即可。


iOS SSZipArchive--压缩与解压缩
图示.png

压缩

    NSString *str = @"/Users/mazaiting/Desktop/tomcat.zip";
    
    [SSZipArchive unzipFileAtPath:str toDestination:@"/Users/mazaiting/Desktop/tomcat"];

解压缩

    [SSZipArchive createZipFileAtPath:@"/Users/mazaiting/Desktop/tomcat1.zip" withContentsOfDirectory:@"/Users/mazaiting/Desktop/tomcat"];

相关文章: