我做到了
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://maps.googleapis.com/maps/api/place/search/json?location=30.722322,76.76126&radius=500&types=food&sensor=true&key=any_apiKey"]];
NSURLResponse *response;
NSError *error;
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
NSString *strResponse = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
NSLog(@"%@",strResponse);
SBJSON *sbJason = [[SBJSON alloc] init];
NSMutableDictionary *getPlaceList = [sbJason objectWithString:strResponse];
Run Code Online (Sandbox Code Playgroud)
//但我得到了这个 -
{
"html_attributions" : [],
"results" : [],
"status" : "REQUEST_DENIED"
}
Run Code Online (Sandbox Code Playgroud)
**API Key是否有任何问题我已经写了谷歌地图给出的API密钥.api密钥有什么问题或者请告诉我这里是google api的链接