(Conversion) in Xcode, configure ARC support for some files, xcodearc
What is ARC?
ARC is a new feature launched by iOS 5, which is called Automation Reference Counting ). Simply put, the retain/release is automatically added to the Code. The Code that was manually added to handle the reference count of memory management can be automatically completed by the editor. This mechanism starts to be imported in iOS 5/Mac OS X 10.7 and can be used in Xcode4.2. A simple understanding of ARC is to allow the compiler (LLVM 3.0) to automatically generate the reference count of instances to manage part of the code During code compilation through the specified syntax. One thing is that ARC is not a GC, but a Static Analyzer tool.
In xCode, you often need to import some external code files. If the imported file uses the ARC mechanism and your current project does not use the ARC, xCode will give a warning or report an error. How can we deal with these problems:
Click the project navigation file --> select Targets --> select Build Phases --> Expand Compile Sources
In this case, the second column is named Compiler Flags.
Double-click the ARC file you want to use, and enter-fobjc-arc,
Now this file can be compiled using the ARC Mechanism during compilation.
Similarly, if you want code that uses the ARC mechanism not to use the ARC mechanism, you only need to enter-fno-objc-arc