ios - 是否有预处理器指令导致 XCode 构建失败?

标签 ios c xcode c-preprocessor

是否有预处理器指令会导致 XCode 构建失败? (或 pragma_mark 或其他)

例如,我为 3 个不同的环境开发了一个应用程序,其中包括多个要获取的 Web URL。到目前为止,我不知道将用于生产环境的 URL,并且我想在代码中插入一条指令,以防止预期的构建在此环境中运行。

我的代码看起来像

#ifdef ENV1
...
#endif

#ifdef ENV2
...
#endif

#ifdef ENV3
#some_instruction_that_prevent_success_build
...
#endif

换句话说,我想要一条充当阻塞 TODO 的指令。

最佳答案

错误预处理器指令就是您所追求的。

#error "Danger, Will Robinson!"

关于ios - 是否有预处理器指令导致 XCode 构建失败?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7891113/

相关文章:

ios - Swift 中的 scrollToRowAtIndexPath 问题

ios - 如何在不使用 Swift 3 淹没我的 API 的情况下读取 HTTP 请求

具有 bison 和 flex 的 Calc 无法进行负操作

c - 如何使用 OpenGL 将正方形居中?

ios - 更新推送证书并保持当前 App Store 应用程序正常工作 xcode 8.3.3

ios - UIViewController如何跳转到祖 parent View ?

javascript - 移动版 Safari : prevent scroll page when focus on input

c - 在不知道维度的情况下在 C 中创建指向多维数组的指针

xcode - OSX : how to localize the name appearing when the mouse flies over the app icon in the dock?

ios - Branch io iOS 链接总是重定向到 App Store 而不是我们的应用程序