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