Parse Conditional compilation in Xcode

Source: Internet
Author: User

Resolution inXcodeIn progressConditional compilationIs the content to be introduced in this article, mainly introduces how to implementXcodeIn progressConditional compilationAnd let us solve the problem again.XcodeThe content is not much. Let's take a look at the details first.

Conditional compilationNot many advanced technologies, but they are very practical. They can help us compile different versions for different targets. For example, you want to compile a full version of the same code and a free version with limited functions to reduce maintenance costs.

First, get info on a project or target.

On the Build page, find the Preprocessor Macros under GCC 4.2-Preprocessing,

Double-click,

Add a value in the displayed dialog box,

For example, FREE_VERSION.

OK.

Then add the following statement to the Code:

 
 
  1. # If! Defined (FREE_VERSION)
  2. ... // Do for full version
  3. # Else
  4. ... // Do for free version
  5. # End

In this case, compile and try again.

Summary:XcodeIn progressConditional compilationI hope this article will help you!

Related Article

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.