Re: Dictionaries within a dictionary - getAllValuesForKey:
Re: Dictionaries within a dictionary - getAllValuesForKey:
- Subject: Re: Dictionaries within a dictionary - getAllValuesForKey:
- From: "Daniel T. Staal" <email@hidden>
- Date: Thu, 7 Jun 2007 09:14:49 -0400 (EDT)
- Importance: Normal
On Thu, June 7, 2007 8:27 am, Jofell Gallardo said:
> Is there such a method? I just want to get all values that I could get
> for a dictionary of dictionaries (or array of dictionaries).
>
> e.g. I have a collection of dictionaries with key "xackupid". I want to
> collect on a single call all the possible values for xackupid.
>
> How can I do this?
1. Enumerate the outer set.
2. Step through outer set.
3. On each step, collect the value from the inner dictionary.
There isn't an 'automatic' way to do it that I know of, but it can be done
in about four lines of code.
Daniel T. Staal
---------------------------------------------------------------
This email copyright the author. Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes. This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---------------------------------------------------------------
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden