views:

226

answers:

2

Hi, when i add new entries to my settings bundle root.plist file, build and run the app, the new settings are not visible within the app. I've of course used a unique key for the new entries.

In my root.plist file in the xcode project the file shows the changes, but when i get the current file from the iphone via the organizer, the changes are not there.

I am using iOs 4.0.1.

BR, Martin

A: 

Delete and reinstall the app. There's a bug where updated resources may not be installed when the app already exists on the device.

Kevin Ballard
doesn't work. i'va already tried this
Martin
Ok, can you clarify what you mean by "the new settings are not visible within the app"? The root.plist settings file doesn't affect your app. It affects the Settings app. Are you expecting it to define defaults for NSUserDefaults in your app? You're responsible for registering those yourself with `+[NSUserDefaults registerDefaults:]`
Kevin Ballard
i've not defined any settings in the app. everything i've done is, that i've defined my settings (including default values) in the root .plist. and i wanna read them in the app. i can read all the settings that were initially in the file. but the new entries i've added with the property list editor can't be read via the NSUserDefaults. i always get an IllegalArgumgentException. i'll post the root.plist as answer to my question.
Martin
IllegalArgumentException? You're doing something definitively wrong. NSUserDefaults doesn't fire an exception if the value is missing. And it doesn't read root.plist, as I already said - that file *only* affects Settings.app.
Kevin Ballard
A: 

Root.pList

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
<plist version="1.0">
<dict>
    <key>StringsTable</key>
    <string>Root</string>
    <key>PreferenceSpecifiers</key>
    <array>
        <dict>
            <key>Type</key>
            <string>PSGroupSpecifier</string>
            <key>Title</key>
            <string>iParkschein Einstellungen</string>
        </dict>
        <dict>
            <key>Type</key>
            <string>PSTextFieldSpecifier</string>
            <key>Title</key>
            <string>Kennzeichen</string>
            <key>Key</key>
            <string>kennzeichen_preference</string>
            <key>DefaultValue</key>
            <string></string>
            <key>IsSecure</key>
            <false/>
            <key>KeyboardType</key>
            <string>Alphabet</string>
            <key>AutocapitalizationType</key>
            <string>None</string>
            <key>AutocorrectionType</key>
            <string>No</string>
        </dict>
        <dict>
            <key>Type</key>
            <string>PSTextFieldSpecifier</string>
            <key>Title</key>
            <string>Stadt</string>
            <key>Key</key>
            <string>stadt_preference</string>
            <key>DefaultValue</key>
            <string>Wien</string>
            <key>IsSecure</key>
            <false/>
            <key>KeyboardType</key>
            <string>Alphabet</string>
            <key>AutocapitalizationType</key>
            <string>None</string>
            <key>AutocorrectionType</key>
            <string>No</string>
        </dict>
        <dict>
            <key>Type</key>
            <string>PSToggleSwitchSpecifier</string>
            <key>Title</key>
            <string>Firmenrechnung</string>
            <key>Key</key>
            <string>firmenrechnung_preference</string>
            <key>DefaultValue</key>
            <true/>
        </dict>
        <dict>
            <key>Type</key>
            <string>PSTextFieldSpecifier</string>
            <key>Title</key>
            <string>Kennzeichen</string>
            <key>Key</key>
            <string>servicenummer_preference</string>
            <key>DefaultValue</key>
            <string></string>
            <key>IsSecure</key>
            <false/>
            <key>KeyboardType</key>
            <string>Alphabet</string>
            <key>AutocapitalizationType</key>
            <string>None</string>
            <key>AutocorrectionType</key>
            <string>No</string>
        </dict>
    </array>
</dict>
</plist>

if i read the keys from the userdefaults and write them to the console, i get ever key except the servicenummer_preference

BR, Martin

Martin