• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
reading keys from a plist file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

reading keys from a plist file


  • Subject: reading keys from a plist file
  • From: Tavis <email@hidden>
  • Date: Mon, 1 Dec 2003 02:16:07 -0800

Could someone please help me figure out how to read in an int from a
plist.

I'm trying to get one value from the parameters key (see below):

<plist version="1.0">
<dict>
<key>AppleSymbolicHotKeys</key>
<dict>
<key>32</key>
<dict>
<key>enabled</key>
<true/>
<key>value</key>
<dict>
<key>parameters</key>
<array>
<integer>-1</integer>
<integer>101</integer> //I want this integer
<integer>0</integer>
</array>
<key>type</key>
<string>standard</string>
</dict>
</dict>
<...>

I want the data from the parameters key inside of key 32 (
<integer>101</integer> )

so far ive got this:

- (BOOL) getdata
{
id obj;

NSString *ourAppsPath = [[NSBundle mainBundle] bundlePath];
NSDictionary *loginItemDict = [NSDictionary
dictionaryWithContentsOfFile:[NSString
stringWithFormat:@"%@/Library/Preferences/
com.apple.symbolichotkeys.plist", NSHomeDirectory()]];
NSEnumerator *loginItemEnumerator = [[loginItemDict
objectForKey:@"AppleSymbolicHotKeys"] objectEnumerator];


while (( obj = [loginItemEnumerator nextObject] ) != nil )
{

//how do I get key 32's 3rd parameter value? maybe don't even
enumerate ?
}

}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: reading keys from a plist file
      • From: OL&L Dev 2 <email@hidden>
    • Re: reading keys from a plist file
      • From: "M. Uli Kusterer" <email@hidden>
    • Re: reading keys from a plist file
      • From: Stephane Sudre <email@hidden>
  • Prev by Date: Re: NSColorWell and alpha values
  • Next by Date: Re: NSColorWell and alpha values
  • Previous by thread: Re: NSColorWell and alpha values
  • Next by thread: Re: reading keys from a plist file
  • Index(es):
    • Date
    • Thread