Search code examples
iosbashplist

Delete <dict>...</dict> from *.plist file iPhone script


I would like to write a script that delete one specified dict from *.plist file, but nothing that I found on the internet doesn't work.. Is there a way to do that ? I've tried sed comman but this doesn't work


Solution

    1. Read the plist file into a NSDictionary. [Docs]
    2. Make a mutableCopy of this to get a dictionary you can work with.
    3. Remove the item you wish to remove
    4. Write the dictionary back to disk. [Docs]