iOS解压缩文件

引入第三方库SSZipArchive

压缩文件

[SSZipArchive createZipFileAtPath:@"/Users/Apple/Desktop/123.zip" withContentsOfDirectory:@"/Users/Apple/Desktop/images"];

解压文件

   [[[NSURLSession sharedSession] downloadTaskWithURL:url completionHandler:^(NSURL * _Nullable location, NSURLResponse * _Nullable response, NSError * _Nullable error) {
        //解压
        [SSZipArchive unzipFileAtPath:location.path toDestination:[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject]];
        NSLog(@"解压完成 %@",location);
        
    }] resume];

发布了368 篇原创文章 · 获赞 22 · 访问量 20万+

猜你喜欢

转载自blog.csdn.net/BianHuanShiZhe/article/details/105013469