From what I understand, the response JSON
data that you get, is an array of dictionaries within a dictionary.
To retrieve each of those values, you may use the following steps:
Step 1:
Separate the array of dictionaries from the result dictionary into an NSArray
object.
NSArray *resultArray = [resultDictionary objectForKey:@"results"];
Step 2:
Now that you have the resultArray
, you can extract the values that you want as follows:
Suppose you want the value of NSNumber
object "Number of matches"
,
You know that its the 3rd
object in the resultArray
, so its index is 2
.
NSDictionary *dictionary = [resultArray objectAtIndex:2];
NSNumber *numberOfMatches = [dictionary objectForKey:@"Number of matches"];
Now you can use the [numberOfMatches intValue]
wherever you want.
Hope this helps! :)