XCode Obj-C: Make new NSArray from one key each out of an Array of Dictionaries
Posted
by user323772
on Stack Overflow
See other posts from Stack Overflow
or by user323772
Published on 2010-04-22T23:08:27Z
Indexed on
2010/04/22
23:13 UTC
Read the original article
Hit count: 187
This actually could be a multipart question. But here's the first part ...
I have an array (actually in a plist) of dictionaries. Each dictionary has 3 keys in it: (title), (points), and (description).
I am trying to make a NEW array with the values of the key "title" from each dictionary in that first array.
Let me explain WHY I am doing this and maybe that will provide a better all around explanation.
I am trying to let people pick from a pre-determined list. Heck, if this was a web page it would be very simple since all I really care about are the "points" and the "Title". On a web site I could simply do a drop down combo-box with the "points" being the value and the title being the text for each row.
But this is not a web page.
So what I am trying to do here is pop out a modal picker when they click the text field. The modal picker shows the alphabetical ordered "titles" from our new array. And whichever one they select, it closes the modal view and assigns that "title" text to the UITextField which cannot be edited by the user.
I have some code to get my modal picker to pop out. But I need to feed it an array of just the "titles" of each dictionary in my real array.
Thanks in advance (and yes I am a newbie)
© Stack Overflow or respective owner