• 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
Re: reading keys from a plist file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reading keys from a plist file


  • Subject: Re: reading keys from a plist file
  • From: OL&L Dev 2 <email@hidden>
  • Date: Mon, 1 Dec 2003 09:35:42 -0800

You *could* use CFDictionaryGetValue.

James

At 2:16 AM -0800 12/1/03, Tavis wrote:
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.
_______________________________________________
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.

References: 
 >reading keys from a plist file (From: Tavis <email@hidden>)

  • Prev by Date: How to get NSImage into an NSMutableAttributedString ?
  • Next by Date: Re: Source code documentation systems for Cocoa
  • Previous by thread: Re: reading keys from a plist file
  • Next by thread: Re: newbie memory question
  • Index(es):
    • Date
    • Thread