iOS about RAR decompression third-party library Unrar4ios Usage Summary

Source: Internet
Author: User
Tags repetition

The author of the recent company project to do RAR decompression function, found on the internet for a long time seemingly about RAR decompression data very little, but a lot of people recommend a "Unrar4ios" third-party open source framework, so download and try to discover the open source framework and in the use of the process found some existing problems, Special here to make a summary let Yimeimei less go some detours.

1. armv7s is not supported;

2. The compiled framework will compile Unrar4iOS.h and unrar4ios.mm in some ways that are not implemented, such as-(BOOL) Unrarfileto: (nsstring*) path overWrite: (BOOL) Overwrite; The implementation of this method is actually empty, that is, nothing is done (the original author eventually updated two files but did not recompile the framework);

3. For the second question, it may be said that the two files of Unrar4iOS.h and unrar4ios.mm are being pulled back into the project. The answer is "if the other link flags in your project are not set to-OBJC, you can do so, otherwise you will report some duplicate identifiers."

In view of the above problems I would like to use the latest source to recompile a framework to support armv7s, but drag the source code into other projects to report a variety of compilation errors, because the time problem eventually abandoned, If there is any kind person who will be up-to-date and compile successfully a framework words welcome to leave me a message or directly open source (the vast number of farmers will be greatly appreciated).

Well, now, let's just say how I do it.

In fact, I also used the method mentioned in the third question, our main project other link flags set up the-OBJC this is a fact, I can not in order to integrate this framework and to modify the main project configuration (there are too many changes involved), Then only from the repetition of the marker, since the repetition of I have to change you do not do it (step back to the sky), but like I do so the first problem is not to solve the only pain to abandon the armv7s, the language is often too pale, Next, I'll teach you to integrate the framework into your project step by step to ensure that you do not give an error.

The first step: Download the source code. Links: Https://github.com/ararog/Unrar4iOS

The second step: the extracted Unrar4ios directory under the Rarextractexception and Unrar4ios. H.M file, unrar4iosexample->frameworks-> Unrar4ios.framework are dragged into your project and checked for copy, as shown in:


At this point, if your project opens arc, you may report a mistake and delete the autorelease.

Run again or you'll get an error

Since the header files of RAROS.HPP and DLL.HPP are included in the framework, we will introduce these two header files in the form of angle brackets "<>", modified as follows:

Run again, will find some arc problems, will release and so on Delete can

At this point your project should be able to compile successfully on the simulator, replace the real machine to compile the test, yes will be reported before the armv7s error

Modify the method: Change the first red box to No, delete the arm64 and armv7s in the second red box, keep only armv7.

One more thing, don't forget to add libz.dylib

Now you can check your project configuration, if the other link flags shown do not have the-OBJC tag set, So now you can successfully use the Unrar4ios.framework on the simulator and the real machine, and if you set the-OBJC tag like me, keep looking down.

If-OBJC is set, you should see the following error prompt identifier duplicated, because we dragged the UNRAR4IOS.MM implementation file and the files in the framework are duplicated

The specific solution is to first Unrar4ios and unrar4ios.mm the two files removed from the project, to be modified after the completion of the re-add, I would be to rename the two files as "KWUnrar4iOS.h and kwunrar4ios.mm" And the kwunrar4ios.mm in the two "Callbackproc" modified to "CALLBACKPROCC", the completion of this step can be re-added to the project, the last modified project structure is as follows:

True machine compile OK, to this finally completed all the steps, the following release my own demo link

Https://github.com/zzltjnh/Unrar4iOSDemo

------------------------------------------Gorgeous split-line---------------------------------------------

* A lot of people yesterday. The application that does not support arm64 is unable to submit the AppStore, so today we have a bit of this stuff.

Not to be continued ...

iOS about RAR decompression third-party library Unrar4ios Usage Summary

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.