Changing value for Settings.bundle Preference

DanSiegelDanSiegel ✭✭USUniversity ✭✭

I'm trying to figure out what the best way is to programmatically update the value for a PreferenceSpecifier in my Settings.bundle.

As an example if I have something like:

    <key>PreferenceSpecifiers</key>
    <array>
        <dict>
            <key>Type</key>
            <string>PSGroupSpecifier</string>
            <key>Title</key>
            <string>Credentials</string>
        </dict>
        <dict>
            <key>Type</key>
            <string>PSTextFieldSpecifier</string>
            <key>Title</key>
            <string>Username</string>
            <key>Key</key>
            <string>username</string>
            <key>DefaultValue</key>
            <string></string>
        </dict>
    </array>

I can read the Settings.bundle to get the value for the specified key, unfortunately I haven't found a way of updating the value for the specified key from code. Hopefully someone has tackled this issue previously.

Tagged:
Sign In or Register to comment.