10

I am trying to unzip folder with in my iPhone application. Can any one help me on this. Thank you.

nitesh meshram
  • 281
  • 2
  • 4
  • 10

3 Answers3

24

You need to use SSZipArchive in order to working with zip files.

Below line would unzip your zip file.

[SSZipArchive unzipFileAtPath:path toDestination:destination];
Erik B
  • 40,889
  • 25
  • 119
  • 135
Deeps
  • 4,399
  • 1
  • 26
  • 27
  • This is great for ZIP64 compatibility but it is SLOW on zip files with many small files in them. – Jann Oct 09 '13 at 00:18
5

Download zipArchieve.zip file which used to unzip files in iPhone.

It contains following things...

zipArchieve.zip click here to download

1.minizip folder
2.ZipArchive.h
3.ZipArchive.mm

Then just drag & drop ZipArchive folder in to xCode "Classes".

Then add framework libz.1.2.3.dylib.

That's it. My code get compile without any issue.

Prasanna
  • 945
  • 10
  • 24
Karthikkumar
  • 221
  • 2
  • 6
  • In Xcode 4.6 i was unable to find libz.1.2.3.dylib.But adding libz.1.1.3.dylib worked for me – Desert Rose Mar 01 '13 at 07:49
  • This is incompatible with Zip64 (+4GB or +65535 files) zip files. Best to use ssArchive as stated above. Minizip 1.0.x is not zip64 aware--nor does zipArchive handle it. – Jann Oct 09 '13 at 00:18
1

USE ZipArchive

iProgrammer
  • 3,099
  • 3
  • 33
  • 59