After os5.0, you can use arc (automatic reference counting: automatic reference count) to replace the previous MRC (manual reference counting: manual reference count ). Using Arc reduces the trouble of code and forgetting to release objects. But everything has two sides. If you want to reuse the previously written MRC class after using arc, an error will be reported. What should I do at this time? The method is relatively simple. You only need to perform the following steps to solve the problem:
Under compile sources under the build phases option of targets, select the file to be compiled by arc, double-click it, and enter-fno-objc-arc.
The arc class can also be used in the MRC project. The method is as follows:
Under compile sources under the build phases option of targets, select the file to be compiled using arc, double-click it, and enter-fobjc-arc.
Hybrid use of MRC and arc