The JSON string contains not a dictionary, but an array (of two dictionaries). So you would do
SBJsonParser* parser = [SBJsonParser new];
NSArray* jsonArray = [parser objectWithString:resp];
and access the values for example like
NSString *secondName = [[jsonArray objectAtIndex:1] objectForKey:@"name"];
or, using the modern subscripting syntax:
NSString *secondName = jsonArray[1][@"name"];
(Note that there already is a NSJSONSerialization
class in Foundation, so unless you
have a specific reason to use SBJsonParser
, you could use that as well.)