Compression / decompression library for iPhone and Xcode 4

I am working on a project that requires downloading an archived file from the server, and I am trying to unzip it on an iPhone. It seems that there are a number of solutions, such as LiteUnzip , ZipArchive, and several others, but none of them are clearly effective like the two. The problem I am facing is to make one of them in my Xcode 4 project.

LiteUnzip is in C, and I hardly used it. If you have any sample code on how to use it to unzip a single archived file (containing about 60 files), that would be great.

ZipArchive seems to be a favorite here, but I cannot compile it without errors. I follow the instructions http://code.google.com/p/ziparchive/issues/detail?id=4 , creating a static library for iphone, but I keep getting errors like this:

Undefined symbols for architecture armv6: "_crc32", referenced from: -[ZipArchive addFileToZip:newname:] in libziparchive.a(ZipArchive.o) _unzReadCurrentFile in libziparchive.a(unzip.o) 

All the sources I found are successful in Xcode 3.2, but I work in Xcode 4.

Has anyone had success in Xcode 4 with any of these libraries? Otherwise, do you know about the library with which you had success?

+4
source share
1 answer

Here is what I ended up using: http://code.google.com/p/objective-zip/

I use it like this:

 #import "../Objective-Zip/ZipFile.h" #import "../Objective-Zip/ZipException.h" #import "../Objective-Zip/FileInZipInfo.h" #import "../Objective-Zip/ZipWriteStream.h" #import "../Objective-Zip/ZipReadStream.h" ZipFile *unzipFile = [[ZipFile alloc] initWithFileName:zippedfile mode:ZipFileModeUnzip]; NSArray *infos = [unzipFile listFileInZipInfos]; 

etc. This is a really simple shell for ZLib and MiniZip. No need to link static libraries or anything else, just import the headers and go.

+9
source

Source: https://habr.com/ru/post/1348030/


All Articles