Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 从代码中隐藏设置包选项_Objective C_Ios_Settings.bundle - Fatal编程技术网

Objective c 从代码中隐藏设置包选项

Objective c 从代码中隐藏设置包选项,objective-c,ios,settings.bundle,Objective C,Ios,Settings.bundle,在我的应用程序中,我在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)

在我的应用程序中,我在
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的单独开发目标
  • 在单个目标的构建阶段使用
    运行脚本
    修改Settings.bundle添加
    调试
    配置的部分,检查
    配置
    变量

嗯,他要求的是“来自代码”。拥有两个独立的Settings.bundle本身就带来了很多问题,但是在构建过程中操纵脚本是个好主意。我认为他并不是指真正从代码中完成,而是指自动化。必须清楚的是,没有合法的方法在运行时修改应用程序包。