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

Re: reading a plist


  • Subject: Re: reading a plist
  • From: Koen van der Drift <email@hidden>
  • Date: Sun, 21 Jul 2002 11:28:37 -0400

It seems you got quite confused here, you get the "testkeys" dictionary from
the file, then try to branch two levels down to get at KeyA2 with one
objectForKey. Try this:
NSDictionary *myList = [NSDictionary dictionaryWithContentsOfFile: path];
NSString *myString = [[[myList objectForKey:@"testkeys"]
objectForKey:@"KeyA"] objectForKey:@"KeyA2"];
You just skipped past a step, you cannot get at KeyA2 without accessing KeyA.


Thanks Kyle, that makes more sense. What I still can't get to work is to
read an array from the plist, only containg KeyA, KeyB, KeyC, etc.

I want to do this to populate an NSBrowser with KeyA, KeyB, etc. And then
when the user selects a cell, I can access its data from the plist, using
the code you wrote above.


- Koen.
_______________________________________________
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: 
 >Re: reading a plist (From: Kyle Moffett <email@hidden>)

  • Prev by Date: Re: NSBeginAlertSheet and (void*)contextInfo
  • Next by Date: Re: creating folders inside the main bundle
  • Previous by thread: Re: reading a plist
  • Next by thread: Re: reading a plist
  • Index(es):
    • Date
    • Thread