IOS Arc and non-arc files mixed

Source: Internet
Author: User


arc in SDK4.0 added, the combination of arc and non-arc files will be combined with the previous project.

Of course, in both cases:



1. No arc was used for his old project, but the third-party library was introduced using arc.
2. Your new project uses arc, but the introduction of the code does not use arc.


In both cases, the direct affirmation is not compiled. It can be solved by upgrading the old project to use arc, but this approach is sometimes cumbersome.
An easy way to do this is to specify whether a single file will be compiled with arc.
The method is to find the file that needs special processing in the compile source inside the build phase, plus the compile option (Compiler Flags), which is different for both cases.


1. For the first case, add the-FOBJC-ARC option to the source file with the arc
2. For the second case, add-fno-objc-arc


One small step per day.

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.