Re: reading keys from a plist file
Re: reading keys from a plist file
- Subject: Re: reading keys from a plist file
- From: Stephane Sudre <email@hidden>
- Date: Mon, 1 Dec 2003 11:34:17 +0100
I don't understand the problem. You have all the cards in your hands.
As there's no check syntax feature in Mail.app, there might be some
errors in the code I added.
On Monday, December 1, 2003, at 11:16 AM, 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>
<...>
- (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 )
{
NSDictionary * tDictionary;
tDictionary=[obj objectForKey:@"value"];
if (tDictionary!=nil)
{
NSArray * tArray;
tArray=[tDictionary objectForKey:@"parameters"];
if (tArray!=nil)
{
int tCount;
tCount=[tArray count];
if (tCount>=2)
{
NSNumber * tNumber;
tNumber=[tArray objectAtIndex:1];
}
}
}
}
}
_______________________________________________
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.