本文介绍了如何在iOS上解压缩.zip文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在StoreKit下载IAP内容包后,它会向我返回一个NSURL,如下所示:
After StoreKit downloads the IAP content package it returns an NSURL to me which looks like this:
尽管我发现所有来源都声称StoreKit在下载后解压缩了内容包,但它还是通过ZIP传递给我。此ZIP可能包含内容包的文件结构。但是如何解压缩?
Despite all sources I found claiming that StoreKit unzips the content package once downloaded, it hands me over a ZIP. This ZIP probably contains the file structure of the content package. But how do I unzip this?
推荐答案
使用
您可以使用此解压缩
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *outputPath = [documentsDirectory stringByAppendingPathComponent:@"/ImagesFolder"];
NSString *zipPath = Your zip file path;
[SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
希望对您有帮助。
这篇关于如何在iOS上解压缩.zip文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!