Re: NSDictionary and plist
Re: NSDictionary and plist
- Subject: Re: NSDictionary and plist
- From: Charilaos Skiadas <email@hidden>
- Date: Fri, 5 Aug 2005 16:34:51 -0500
On Aug 5, 2005, at 4:25 PM, Jeff Childers wrote:
I am trying to access a plist and then use the data
my plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>A</key>
<dict>
<key>art_high</key>
<integer>12</integer>
</dict>
</dict>
</plist>
NSMutableDictionary * myGlobals;
myGlobals = [[NSDictionary dictionaryWithContentsOfFile:
[@"test.plist"
stringByExpandingTildeInPath]] retain];
NSLog([[myGlobals objectForKey:@"A"] objectForKey:@"art_high"]);
[[myGlobals objectForKey:@"A"] objectForKey:@"art_high"] is an
NSNumber, and then you input it into NSLog, which expects a string.
Try instead:
NSLog(@"%@",[[myGlobals objectForKey:@"A"] objectForKey:@"art_high"]);
-[NSCFNumber length]: selector not recognized
<NSInvalidArgumentException> *** -[NSCFNumber length]: selector not
recognized
can someone tell me what I am doing wrong? I tried to google cocoa
NSDictionary of NSDictionaries, cocoa dictionary of dictionaries
Haris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden