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.
First way, Edit->refactor, convert to Arc mode
The famous iOS network Framework asihttprequest is MRC, we can try to convert to arc
Click Check, we found a tragedy.
In most cases this is going to go wrong, what should we do?
The second way, add markup to the compiler
Can 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 project
Third Way, packaged into a static library
Drag the class we're going to use into the project
Tick the correct target
Delete the original class file, leaving only what we need, then we'll turn the whole project into MRC
Add header File
Set up a common header file
Running the program, we find that the static library has been generated
The disadvantage of this approach is that if you need to change the source, you need to repackage
One last way, project references
Create a new project, change to non-arc, and reference the project in another project
We need to remove the irrelevant files from Project B.
The last way to rewrite yourself into an arc way
iOS Development arc MRC Mixed