Re: reading a plist
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.