我可以改變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