Decompress

  • 用ZipArchive框架
  • 再导入libz.dylib

  • 压缩
- (void)createZipFile2
{
    [Main createZipFileAtPath:@"/Users/xiaomage/Desktop/TestAbc.zip" withContentsOfDirectory:@"/Users/xiaomage/Desktop/Test"];
}

- (void)createZipFile
{
    NSArray *paths = @[
                       @"/Users/xiaomage/Desktop/Test/Snip20150713_276.png",
                       @"/Users/xiaomage/Desktop/Test/Snip20150713_299.png",
                       @"/Users/xiaomage/Desktop/Test/Snip20150713_500.png"
                       ];
    [Main createZipFileAtPath:@"/Users/xiaomage/Desktop/TestAbc.zip" withFilesAtPaths:paths];
}
  • 解压

    [Main unzipFileAtPath:@"/Users/xiaomage/Desktop/TestAbc.zip" toDestination:@"/Users/xiaomage/Desktop"];

results matching ""

    No results matching ""