阅读背景:

IOS解压缩和压缩文件

来源:互联网 
以前提到过 Android解压缩zip的实现方式,现在讲解一下IOS中解压的方法。

压缩文件:

ZipArchive *zip = [[ZipArchive alloc] init]; NSString *sZipPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/test.zip"]; NSString *img1Path = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/img1.jpg"] ; NSString* img2Path = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/img2.jpg"] ; BOOL bRet = [zip CreateZipFile2:sZipPath]; bRet = [zip addFileToZip:img1Path newname:@"img1.jpg"]; bRet = [zip addFileToZip:img2Path newname:@"img2.jpg"]; [zip CloseZipFile2]; [zip release]; Z


你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: