Since ios5, automatic reference count (ARC) has been introduced, that is, every time an obj-C object is "used", the reference count will increase by 1, when the reference count is 0, the system recycles the memory. These are all done by the compiler itself. Rather than the arc in the OC program, the alloc should be release, and the retain/copy should also be release, which is a non-arc in the legend.
When using a third-party class library, sometimes the memory management mechanism of the third-party class library is different from its own, but I still want to use it. What should I do?
The specific method is as follows:
1. select targets in the project and select the target you want to operate on,
2. select build phases. In complie sources, double-click the file that requires arc, and enter-fobjc-arc in the input box. If not, enter-fno-objc-arc.
That is to say, if your project is non-arc and the third-party class library is using arc, you only need to add the following file after the third-party class library that uses arc:-fobjc-arc, otherwise, add-fno-objc-arc.
, I used an arc class library in a non-arc project. The setting method is as follows:
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/40/4E/wKiom1POXHWijX8RAAZEUjq8rfc676.jpg "Title =" QQ20140722-1.png "alt =" wkiom1poxhwijx8raazeujq8rfc676.jpg "/>
This article is from the "one hair" blog, please be sure to keep this source http://winann.blog.51cto.com/4424329/1441522
Working with a non-arc (or arc) framework or class library in an arc project