Re: Navigating property lists using paths?
Re: Navigating property lists using paths?
- Subject: Re: Navigating property lists using paths?
- From: Chris Hanson <email@hidden>
- Date: Sun, 22 Jun 2003 15:35:33 -0400
On Sunday, June 22, 2003, at 02:49 AM, Scott Andrew wrote:
I have a question. I have to navigate deep into a property list (about
9 - 10 levels). Can do this with a path string? Similar to
"\foo\bar\i\am".. What class would I want to do this with? Right now i
am create a dictionary for each level.
Yes. You would just use NSDictionary, but instead of using
-objectForKey: and -setObject:forKey:, you would use key-value coding.
To traverse paths, use -valueForKeyPath: and -takeValue:forKeyPath:,
and use path strings like "foo.bar.i.am".
Does the item dictionary get cleaned up properly?
Yes. Since neither the value of root nor the value of item came from
an +alloc or -copy method, and since you didn't send either of them
-retain, they are autoreleased objects that will eventually be sent
-release.
-- Chris
--
Chris Hanson, bDistributed.com, Inc. | Email: email@hidden
Custom Application Development | Phone: +1-847-372-3955
http://bdistributed.com/ | Fax: +1-847-589-3738
http://bdistributed.com/Articles/ | Personal Email: email@hidden
_______________________________________________
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.