Objective c 我试着下载这个地理编码数据
基本上我正在访问这个URL 但是,结果是空的。即使它应该显示一些东西。我用了objective-c 使用此代码:Objective c 我试着下载这个地理编码数据,objective-c,google-maps,url,Objective C,Google Maps,Url,基本上我正在访问这个URL 但是,结果是空的。即使它应该显示一些东西。我用了objective-c 使用此代码: response= [NSURLConnection sendSynchronousRequest:request returningResponse:&urlresponse error:&error]; json_string = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncod
response= [NSURLConnection sendSynchronousRequest:request returningResponse:&urlresponse error:&error];
json_string = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
我认为|需要进行URL编码。如何做到这一点
[NSURLConnection sendSynchronousRequest:request returningResponse:&urlresponse error:&error];
返回NSData,序列化后将生成JSON,因此需要执行以下操作:
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingAllowFragments error:&error];
获取JSON。可能重复。看见