iphone - Accessing NSDictionary inside NSArray -


i have nsarray of nsdictionary. each dictionary in array has 3 keys: 'name', 'sex' , 'age'

how can find index in nsarray of nsdictionary where, example, name = 'roger'?

    nsuinteger count = [array count];     (nsuinteger index = 0; index < count; index++)     {           if ([[[array objectatindex: index] objectforkey: @"name"] isequaltostring: @"roger"])         {               return index;         }        }     return nsnotfound; 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -