• 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: NSDictionary and plist
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >NSDictionary and plist (From: Jeff Childers <email@hidden>)

  • Prev by Date: NSDictionary and plist
  • Next by Date: Re: NSDictionary and plist
  • Previous by thread: NSDictionary and plist
  • Next by thread: Re: NSDictionary and plist
  • Index(es):
    • Date
    • Thread