【问题标题】:how to unzip file from objective-c ios 9如何从objective-c ios 9解压文件
【发布时间】:2016-04-25 23:42:56
【问题描述】:

我如何在 ios 8 或 ios 9 中从 Objective-c 解压缩文件,我使用 ZipArchive 和另一个框架但无法工作显示“Build Projectname Failed”,但不显示错误或警告。

【问题讨论】:

  • 你能在这里分享你的代码吗?
  • 您可能缺少一些配置。这就是您收到此错误的原因。仔细检查设置 ZipArchive 的步骤(如果有)。

标签: objective-c xcode ios9 unzip


【解决方案1】:

你可以试试这个库:

1.SSZipArchive

然后你就可以用这个代码解压了

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];

希望对你有帮助。

【讨论】:

  • 此答案中指向 SSZipArchive 的链接实际上指向问题中包含的同一个库,但在问题中称为 ZipArchive。 SSZipArchive 基于 ZipArchive。 SSZipArchive 在引用自身的方式上应该保持一致。叹息……
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-06-30
  • 1970-01-01
  • 2016-01-23
相关资源
最近更新 更多