我有一個設置捆綁在我的應用程序..含root.plist 現在我有一個屏幕,包含按複選框複選框 .. 我想改變BOOL值默認值.png中的PSToggleSwitchSpecifier的關鍵字。 由於它在運行時完成..我的問題是..該文件可以在運行時更改,如果是的話..給一個想法如何做到這一點?我可以動態修改設置包中的Root.plist嗎?
這裏是plist中:
<plist version="1.0">
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>DefaultValue</key>
<string></string>
<key>Key</key>
<string>Username</string>
<key>Title</key>
<string>Username</string>
<key>Type</key>
<string>PSTextFieldSpecifier</string>
</dict>
<dict>
<key>DefaultValue</key>
<string></string>
<key>IsSecure</key>
<true/>
<key>Key</key>
<string>Password</string>
<key>Title</key>
<string>Password</string>
<key>Type</key>
<string>PSTextFieldSpecifier</string>
</dict>
<dict>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string> <-----toggleSwitch
<key>Title</key>
<string>Remember</string>
<key>Key</key>
<string>CheckBox</string>
<key>DefaultValue</key> <----- Default Value
<false/> <---- want to change this value
</dict>
</array>
<key>Title</key>
<string>Settings</string>
</dict>
</plist>
預先感謝您;)
這是一篇博客文章,其內容相同[http://iphonesdevsdk.blogspot.com/2011/04/plist.html]。 –
這是不是爲root.plist我猜 – Zaraki
是的,這是正確的。正如約書亞所建議你不能修改應用程序包中的文件。我希望上面的鏈接可以幫助你。 –