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:
- # If! Defined (FREE_VERSION)
- ... // Do for full version
- # Else
- ... // Do for free version
- # End
In this case, compile and try again.
Summary:XcodeIn progressConditional compilationI hope this article will help you!