在我的应用程序中,我在 Settings.bundle
中定义了一个选项,该选项仅用于调试目的。
有没有办法在应用程序处于生产状态时从代码中隐藏此选项,而无需从 Settings.bundle/Root.plist
中手动删除该选项?
大致如下:
#ifdef DEBUG
// Remove the option from the settings bundle
#else
// Show the option in (or don't actually remove the option from) the settings bundle
#endif
谢谢!
最佳答案
有几个选项:
- 使用带有特殊 Settings.bundle 的单独开发目标,
- 在构建阶段使用
Run script
修改Settings.bundle,为单个目标添加DEBUG
配置部分,检查CONFIGURATION
变量那个。
关于objective-c - 从代码中隐藏设置捆绑选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13119725/