So I am new to Objective C and I am trying to parse a dictionary representation of the Geocoding API JSON response. Here is what I’ve got:
NSString *responseString = [request responseString];
NSDictionary *responseDict = [responseString JSONValue];
NSDictionary *results = [responseDict objectForKey:@"results"];
NSDictionary *geometry = [results objectForKey:@"geometry"];
I receive a SIGABRT error indicating an invalid selector. I do not know how to remedy this or maybe even better, is there another way of doing nested dictionary access?
You can see the json response here:
EDIT: added more code
In this case, you need to see what responseDict is. It is very possibly nil. You need to determine what value is coming back from [responseString JSONValue] (it could be either an NSDictionary or NSArray – but SBJSON could also return nil for this).
In short, I can pretty much guarantee that responseDict is not an NSDictionary instance.