I am creating an application which unizp the files, after googling I found that we can use libz.dylib which is already available in Cocoa touch. What is strange to me that , I am not able to find any documents for libs.dylib. Can anyone provide me some official documentation ? And also if we want to unzip the files, everyone is suggesting to use some 3rd party libraries to unzip the files. Can't we do with the default libz.dylib ?
Asked
Active
Viewed 6,241 times
2 Answers
6
you can do like this way:-
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];
please also check the example hope its helps you :)
Edit
please visit this :-

Community
- 1
- 1

Nitin Gohel
- 49,482
- 17
- 105
- 144
-
1Thank you. Am using ZipArchive already. But all I want to know is, a apple documentation for libz.dylib and can we using any default API from that to extract the files ? – Cyril Jan 04 '13 at 07:19
1
You can have a try of ZipArchive, which is the easiest lib I have used for zip/unzip affairs in both iOS and MacOS.

onevcat
- 4,591
- 1
- 25
- 31
-
Thank you. Am using ZipArchive already. But all I want to know is, a apple documentation for libz.dylib and can we using any default API from that to extract the files ? – Cyril Jan 04 '13 at 07:20
-
ZipArchive is short and to the point, very clean and I'd recommend it. – B. Nadolson Sep 18 '14 at 12:34