【发布时间】:2012-08-06 15:37:16
【问题描述】:
我正在尝试在 DEV 模式下或在 RELEASE 模式下使用预处理器设置进行简单测试。我的设置如下:
我还有一个 constant.h 文件,我将它包含在 App-prefix.pch 文件中。
文件内容如下:
#ifndef myapp_Constants_h
#define myapp_Constants_h
#pragma mark - Instances
#ifdef DEBUG
#define WEB_SERVICE_BASE_URL @"http://local.someurl.com/"
#define LOGIN_PATH @"app_dev.php/user/login/"
#define REGISTER_PATH @"app_dev.php/user/register/"
#endif
#ifdef RELEASE
#define WEB_SERVICE_BASE_URL @"http://www.someurl.com/"
#define LOGIN_PATH @"user/login/"
#define REGISTER_PATH @"user/register/"
#endif
#endif
当我在连接到 mac 的 iphone 上运行应用程序时,我似乎总是获得 DEBUG 模式设置,即使我应该获得 RELEASE 设置。
为什么??
【问题讨论】:
标签: ios preprocessor-directive