在ios 8中取消归档.tar文件

在ios 8中取消归档.tar文件,第1张

概述我如何在iOS 8中解压缩文件? 我遵循了这些例子:NVHTarGzip,Light-Untar,ZipArchive但是我无法使它们工作. 对于我的团队,我们使用了Light-Untar-for-iOS   https://github.com/mhausherr/Light-Untar-for-iOS 我们这样做的实际代码行是: if let path = NSBundle.mainBundl 我如何在iOS 8中解压缩文件?

我遵循了这些例子:NVHTarGzip,light-Untar,ZipArchive但是我无法使它们工作.

解决方法 对于我的团队,我们使用了light-Untar-for-iOS
  https://github.com/mhausherr/Light-Untar-for-iOS

我们这样做的实际代码行是:

if let path = NSBundle.mainBundle().pathForResource("es_ES",ofType:"tar") {        let documentDirectory:NSArray = NSSearchPathForDirectorIEsInDomains(NSSearchPathDirectory.documentDirectory,.UserDomainMask,true)        let documentDirectoryPath:String = documentDirectory[0] as! String        var fileManager = NSfileManager.defaultManager()        var isDirectory: ObjCBool = ObjCBool(true)        if !fileManager.fileExistsAtPath(documentDirectoryPath + "/\(tolocale)",isDirectory: &isDirectory){            fileManager.createDirectoryAtPath(documentDirectoryPath + "/\(tolocale)",withIntermediateDirectorIEs: true,attributes: nil,error: &error)        }        var destinationPath = documentDirectoryPath + "/\(tolocale)"        NSfileManager.defaultManager().createfilesAndDirectorIEsAtPath(destinationPath,withTarPath: path,error: &error,progress: { (progress) -> VoID in            println("Progress \(progress)")            self.tarTimer?.invalIDate()            self.tarTimer = NSTimer.scheduledTimerWithTimeInterval(1.0,target: self,selector: "untarDone:",userInfo: [fromLocale,tolocale],repeats: false)        })    }
总结

以上是内存溢出为你收集整理的在ios 8中取消归档.tar文件全部内容,希望文章能够帮你解决在ios 8中取消归档.tar文件所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1026027.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存