我可以改变infoPlist布尔为Application supports iTunes file sharing
编程设置信息的plist布尔编程
线沿线的东西:
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"Application_supports_iTunes_file_sharing"] = NO]];
我可以改变infoPlist布尔为Application supports iTunes file sharing
编程设置信息的plist布尔编程
线沿线的东西:
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"Application_supports_iTunes_file_sharing"] = NO]];
这是不可能的,同样的原因,you cannot change values inside plist.info
programmatically。
如果您需要一个可更改的数据元素为您自己的应用程序,它会去NSUserDefaults
。需要静态设置info.plst
中的所有特殊标志。 You can have different flags based on compilation target(比如debug,release),但它需要静态编译到你的bundle中。
问及回答谢谢 – JSA986 2014-10-17 18:37:25
mainBundle是只读的,这就是为什么info.plist在运行时不能被修改的原因。 – 2014-10-17 18:17:23