ARC, MRC Mixed

Source: Internet
Author: User

After Xcode5, the new iOS project, the default is the arc mode, but sometimes we need to use some third-party framework in the project, we download and found that is non-arc, this time we need to do arc and MRC mixed.The first way:Edit->refactor, convert to Arc modeThe famous iOS network Framework asihttprequest is MRC, we can try to convert to arcClick Check, we found a tragedy.In most cases this is going to go wrong, what should we do?The second way:Tagging the compilerCan be in the build phases in the compile sources to add the compilation tag-fno-objc-arc, it is feasible, but the file is much, this way is suitable for less files, the file is more than we want a one plus it, At this time we can use a tool xproj, this is a script, it is easy to add a folder to the files in the compilation tag, the specific way we look at the project home page, can be added to the ARC Project MRC Mark (-FNO-OBJC-ARC), You can also add an arc marker (-FOBJC-ARC) to an MRC projectThe Third Way:Package into a static libraryDrag the class we're going to use into the projectTick the correct targetDelete the original class file, leaving only what we need, then we'll turn the whole project into MRCAdd header FileSet up a common header fileRun the program, we found that the static library has been the disadvantage of this approach is that if you need to change the source, you need to repackage the last way, the project reference to create a new project, instead of Arc, in another project to reference the projectWe need to remove the irrelevant files from Project B.One last WayRewrite yourself into arc mode

ARC, MRC Mixed

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.