Re: Best way to create string from an array of dictionaries?
Re: Best way to create string from an array of dictionaries?
- Subject: Re: Best way to create string from an array of dictionaries?
- From: Keith Blount <email@hidden>
- Date: Mon, 24 Jul 2006 08:24:58 -0700 (PDT)
Brilliant! Thank you very much! That is exactly what I
was missing. The "self" thing didn't work, but using
> [[keywords valueForKey:@"keyword"]
> componentsJoinedByString:@"/n"];
works perfectly, without any need for array categories
or iteration. I always miss the obvious key-value
stuff.
Thanks again, much appreciated.
All the best,
Keith
--- Frédéric Testuz <email@hidden> wrote:
>
> Le 24 juil. 06 à 12:25, Keith Blount a écrit :
>
> > Hello,
> >
> > In my app the user can create an array of keywords
> for
> > each document created and then search by these
> > keywords. The keywords are entered via a table
> view
> > with an NSArrayController, but the search relies
> on
> > searching strings. For the search, I therefore
> need to
> > convert the array of keywords into a plain string.
> >
> > Obviously, NSArray has a great method for this:
> >
> > -componentsJoinedByString:
> >
> > However, each component of my -keywords array is
> an
> > NSDictionary. Each dictionary just contains a
> keyword
> > string for the key "keyword" - there are no other
> > keys. Really, it could be a straightforward array
> > holding the strings directly rather than
> dictionaries,
> > were it not for the fact that NSArrayController
> relies
> > on KVC, and thus the components of my array must
> be
> > dictionaries to work in my bound table view.
>
> This don't work?
> [[keywords valueForKey:@"keyword"]
> componentsJoinedByString:@"/n"];
>
> And I'm not sure, but for the KVC part, try using
> the key "self" in
> the NSArrayController with an array of string
> directly.
>
> Frédéric
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
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