1

I'm editing an iOS app written in objective-c, I have a file called Account.plist and I want to insert values at certain points to update the values the user sees, ideally it would clear all the values and then insert new ones. So far I've had no luck modifying.

    <dict>
        <key>DefaultValue</key>
        <string>01234567891</string>
        <key>Key</key>
        <string>telephone_number</string>
        <key>Title</key>
        <string>Telephone Number</string>
        <key>Titles</key>
        <array>
            <string>01234567891</string>
            <string>01234567892</string>
            <string>01234567893</string>
        </array>
        <key>Type</key>
        <string>PSMultiValueSpecifier</string>
        <key>Values</key>
        <array>
            <string>01234567891</string>
            <string>01234567892</string>
            <string>01234567893</string>
        </array>
    </dict>

Any help appreciated.

Robert
  • 17
  • 4
  • First things first: Where is that `.plist` file stored in the filesystem? – trojanfoe Apr 16 '20 at 08:21
  • Fairly new to this so not 100% sure how to answer, if it helps, the plist is writable by the app as it's used for lots of settings that are written to when the user makes changes. – Robert Apr 16 '20 at 09:14
  • What I'm getting at is that it's common to bundle the initial list with the app bundle but if you want to modify that list it must be saved outside the app bundle, therefore you need to have logic that knows which one to load the next time... – trojanfoe Apr 16 '20 at 09:15
  • The plist is in Root/Settings/InAppSettings.bundle/Account.plist – Robert Apr 16 '20 at 10:37

1 Answers1

0

I found a useful existing answer, apparently the function is called dictionaryWithContentsOfFile.

More here: Updating and saving data in plist

matthias_code
  • 833
  • 8
  • 21