Re: reading keys from a plist file
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.