Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我#ifdef macroIsFreeVersion #endif用来插入仅特定于我的应用程序的精简版的代码。当我在这些语句之间编写代码时,似乎代码突出显示和语法警告已关闭。
#ifdef macroIsFreeVersion
#endif
为什么是这样?
我在构建设置中设置宏
Xcode 根据#if指令的结果高亮显示代码。任何“假”的部分都不会突出显示,因为该代码将被编译出来。如果您将目标切换到“精简版”版本,您应该会看到相反的突出显示。
#if
此功能可以根据当前目标和块内使用的任何“定义”的值轻松查看#if当前是否正确#if。