• 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: 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.

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

  • Prev by Date: Re: NSColorWell and alpha values
  • Next by Date: Re: MutableArrays losing its contents?
  • Previous by thread: reading keys from a plist file
  • Next by thread: Re: reading keys from a plist file
  • Index(es):
    • Date
    • Thread