Hybrid use of MRC and arc

Source: Internet
Author: User



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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.