-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Insert or update array values in plist #54
Comments
You can parse the plist file, which will return a JSON object. At that point you could manipulate the json however you see fit, and then call build() to generate an updated version of the plist file. |
Hi, Thanks a lot for the answer. Can you please help me how to add a "array" Swapna On Fri, Jan 9, 2015 at 10:43 PM, Mike Reinstein notifications@github.com
|
@swapnarachapalli to be honest it's been a while since I've contributed to this library so my memory is a bit rusty. :) Can you parse a plist that has an array, then inspect the parsed object in the browser console? that should give you a good sense of how to modify an array element. |
I know this is a while ago, but I needed this for setting arrays and dictionaries, and everything worked as expected: For a dictionary:XML: <key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict> The key is modelled as an object, with each key/value pair from the dictionary as a property: {
"NSAppTransportSecurity": {
"NSAllowsArbitraryLoads": true
}
} For an array:XML: <key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array> The key is modelled as a javascript array: {
"UISupportedInterfaceOrientations": [
"UIInterfaceOrientationPortrait",
"UIInterfaceOrientationPortraitUpsideDown"
],
} |
Hi,
i need to read the plist file and either insert or update the plist keys with newer values. The values could be array or simple String. How can i do that here ?
-Swapna
The text was updated successfully, but these errors were encountered: