iphone - Grab all values in NSDictionary inside an NSArray -


i have nsarray full of nsdictionary objects, , each nsdictionary has unique id inside. want lookups of particular dictionaries based on id, , information dictionary in own dictionary.

myarray contains:

[index 0] mydictionary object   name = apple,   weight = 1 pound,   number = 294,  [index 1] mydictionary object   name = pear,   weight = .5 pound,   number = 149,  [index 3] mydictionary object (etc...) 

i want name , weight second dictionary object (i won't know index of object... if there 2 dicts, make dictionary [myarray objectatindex:1])

so, know number 149. how able second mydictionary object out of myarray new nsdictionary?

as alternative jacob's answer, ask dictionary find object:

nspredicate *finder = [nspredicate predicatewithformat:@"number = 149"]; nsdictionary *targetdictionary = [[array filteredarrayusingpredicate:finder] lastobject]; 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -