开发者

how can we unzip a file in objective c? [duplicate]

This question already has answers here: Closed 10 years ago.

Possible Duplicate:

Is there any zip decompression for iPhone?

i have a zip file in my document directory and i want to unzip that file using objective c code in xcode how can we do that ? is that p开发者_StackOverflowossible to do that

thanks balraj


i found one greate answer in stack overflow below from this link download and unzip file in iOS please check below

I've used ZipArchive with success in the past. It's pretty ligthweight and simple to use, supports password protection, multiple files inside a ZIP, as well as compress & decompress.

The basic usage is:

NSString *filepath = [[NSBundle mainBundle] pathForResource:@"ZipFileName" ofType:@"zip"];
ZipArchive *zipArchive = [[ZipArchive alloc] init];
[zipArchive UnzipOpenFile:filepath Password:@"xxxxxx"];
[zipArchive UnzipFileTo:{pathToDirectory} overWrite:YES];
[zipArchive UnzipCloseFile];
[zipArchive release];

more examples about this package here

I have also tried SSZipArchive in some projects. Below line would unzip your zip file.

[SSZipArchive unzipFileAtPath:path toDestination:destination];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜