I have an array of dictionaries and I want to get the value of that array in which the key is searching. / P>
For example, I have named this array as And I want to get an array of people with a street address in Chicago. The result will be as follows ( I have looped this but I do not know what has been made of my result: Error: How can I do this? Thanks! locationArray :
({id = 1, info = {name = "Person1 "Address =" Chicago ";}}}} ID = 2, info = {name =" person2 "; address =" Chicago "}}}} id = 3, info = {name =" person3 "; address = " New York "; };};);
chicagoArray ):
({id = 1, info = {name = "Person1"; address = "Chicago";};}; Id = 2, info = {name = "person2"; address = "Chicago";};};);
for
(id result in locationArray) {if ([[Result Value ForKeyPath @ "info.address"] is EqualToString: @ "Chicago"]) // // What is the result inside of Array? // NSArray * resultArray = [[NSArray alloc] initWithObjects: @ ""]; }}
NSMutableArray * entries = [NSMutableArray array]; For (NSDictionary * dict in the array) {NSDictionary * innerDict = dict [@ "info"]; If ([Internal [["" address "] is avatostring: @" Chicago "]) [[Add entries: word];}}
No comments:
Post a Comment