Fetching a value from the settings bundle?

Discussion in 'iPhone/iPad Programming' started by Locker, Mar 9, 2009.

  1. macrumors 6502

    Joined:
    Aug 22, 2007
    Location:
    Staffordshire, UK
    #1
    I'm brand new to programming for the iPhone (with only PHP as previous programming experience) and have managed to put together a simple app which does calculations. I've created a settings.bundle which appears to work, but now I'd like to fetch the values from it to use in my app. My Root.plist looks like this:

    Code:
    <?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">
    <plist version="1.0">
    <dict>
    	<key>Title</key>
    	<string>TestApp</string>
    	<key>PreferenceSpecifiers</key>
    	<array>
    		<dict>
    			<key>Type</key>
    			<string>PSGroupSpecifier</string>
    			<key>Title</key>
    			<string>Set Value</string>
    		</dict>
    		<dict>
    			<key>Type</key>
    			<string>PSMultiValueSpecifier</string>
    			<key>Title</key>
    			<string>Value Selector</string>
    			<key>Key</key>
    			<string>Value Selector</string>
    			<key>DefaultValue</key>
    			<string>0</string>
    			<key>Values</key>
    			<array>
    				<integer>0</integer>
    				<integer>1</integer>
    				<integer>2</integer>
    			</array>
    			<key>Titles</key>
    			<array>
    				<string>One Value</string>
    				<string>Another Value</string>
    				<string>A Third Value</string>
    			</array>
    		</dict>
    	</array>
    </dict>
    </plist>
    
    I want to use the string 'One Value', 'Another Value' or 'A Third Value', depending on what has been selected.

    Any help would be greatly appreciated :)
     
  2. macrumors member

    Joined:
    Aug 7, 2007
    Location:
    Staffordshire, UK
    #2
  3. thread starter macrumors 6502

    Joined:
    Aug 22, 2007
    Location:
    Staffordshire, UK
    #3
    Try as I might (and I did try...), I couldn't seem to find the simple answer I was after. Thank you.
     

Share This Page