SSZipArchive使用详解
2016-02-01 15:18
288 查看
下载SSZipArchive
https://github.com/ZipArchive/ZipArchive
SSZipArchive功能:
解压zip文件
解压密码保护的zip文件
创建zip文件
追加到zip文件
压缩文件
使用一个名字来压缩NSData
使用前:
把SSZipArchive文件添加到项目中
在target中添加libz.dylib
使用方法:
[objc] view
plain copy
// 解压
NSString *zipPath = @"被解压的文件路径";
NSString *destinationPath = @"解压到的目录";
[SSZipArchive unzipFileAtPath:zipPath toDestination:destinationPath];
// 压缩
NSString *zippedPath = @"压缩文件路径";
NSArray *inputPaths = [NSArray arrayWithObjects:
[[NSBundle mainBundle] pathForResource:@"photo1" ofType:@"jpg"],
[[NSBundle mainBundle] pathForResource:@"photo2" ofType:@"jpg"]
nil nil];
[SSZipArchive createZipFileAtPath:zippedPath withFilesAtPaths:inputPaths];
https://github.com/ZipArchive/ZipArchive
SSZipArchive功能:
解压zip文件
解压密码保护的zip文件
创建zip文件
追加到zip文件
压缩文件
使用一个名字来压缩NSData
使用前:
把SSZipArchive文件添加到项目中
在target中添加libz.dylib
使用方法:
[objc] view
plain copy
// 解压
NSString *zipPath = @"被解压的文件路径";
NSString *destinationPath = @"解压到的目录";
[SSZipArchive unzipFileAtPath:zipPath toDestination:destinationPath];
// 压缩
NSString *zippedPath = @"压缩文件路径";
NSArray *inputPaths = [NSArray arrayWithObjects:
[[NSBundle mainBundle] pathForResource:@"photo1" ofType:@"jpg"],
[[NSBundle mainBundle] pathForResource:@"photo2" ofType:@"jpg"]
nil nil];
[SSZipArchive createZipFileAtPath:zippedPath withFilesAtPaths:inputPaths];
相关文章推荐
- POJ 1511 链式前向星+SPFA
- shell中if多重条件
- Oracle Essbase入门系列(四)
- 一个简单可以设定时间的数据缓存库 (附 源码)
- ScrollView里面的EditText的点击空白处键盘消失的问题
- 【分享】iOS功能界面漂亮的弹出框
- LINUX的一些常用操作
- 基于K2 BPM的大型连锁企业开关店选址管理解决方案
- Getting Started with Erlang
- EXT--当defaultType与items的子组件默认xtype冲突时items的子组件的xtype为panel
- 设计模式(6)--Bridge 桥接模式
- 【校内互测】YL杯超级篮球赛
- poj1995
- VC++6.0注释快捷键的添加使用
- 【转】 Ubuntu11.10 下安装 jdk
- poj3090
- WDK驱动程序环境搭建
- android笔记
- jxl.read.biff.BiffException: Unable to recognize OLE stream
- 2 类与对象