Decompress in IOS

Source: Internet
Author: User

Today, we have finally completed the two mainstream compression formats ..

I have encountered a lot of ups and downs on the way. Baidu Google has countless articles, but I still want to thank the cool people on the Internet ..

Here, we will make some records and contribute some resources, and provide some help to the children who need to decompress the relevant needs in IOS.

Before you start, list the links that are helpful to me. Thank you!

1: source code for RAR decompression:

Https://github.com/ararog/Unrar4iOS

2: This helps me solve the following problems:

Http://stackoverflow.com/questions/7785659/is-there-an-unrar-library-out-there-for-ios

3: source code for zip decompression:

Http://code.google.com/p/ziparchive/

4: Zip decompression tutorial

Http://blog.sina.com.cn/s/blog_833996210100udkl.html

For these two mainstream formats, I have made a demo and modified the decompressed source code to ensure no bugs ..

This demo demonstrates how zip and RAR are extracted.DocumentsDirectory. click the button and you can goDocumentsDirectory to view the extracted results.

In addition, the compressed source code of zip and RAR has been packaged into the framework for future convenience.

In this example, I also directly use the framework to implement compression-related functions. (For the framework creation, clickHere)

Please try again after downloading the demo!

Demo:Click here.

Note the following:

1: when using the zip framework, we need to first introduce a libz. dylib file for our project. Otherwise, the file cannot be passed during compilation .(It hurts a lot ~, I don't know why. If you know, I 'd like to explain it in a comment. Thank you.)

2: Make sure that your entire project is compiled in the C ++ mixed compiling mode.

3: The RAR framework does not need to introduce files. After importing the framework, you can directly use it.

Finally, the demo is shown as follows:

Date:

IPhone 5Powered by the A6 processorArmv7sMode compilation ,.

The previously provided decompression demo does not support armv7s. Therefore, xcode cannot be installed on the real machine during debugging.

Two solutions:

1. Delete the compilation support for armv7s from the project. The operations are as follows:

2: Re-compilation does not support armv7s framework. A6.

When re-compiling the RAR framework, in particular, the folder name in the directory chain cannot have spaces, otherwise the compilation will fail, which is probably a bug in xcode.

So here, I uploaded the compressed demo after I re-compiled it.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.