1

我正在尝试使用以下方法从 Google 返回 JSON:

NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com.br/maps/api/directions/json?origin=%@&destination=%@&sensor=false", pointOrigem, pointDestino];
    NSURL *url = [NSURL URLWithString:urlString]; 
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [NSURLConnection connectionWithRequest:request delegate:self];

    NSLog(@"%@", urlString);

如您所见,我已经记录了 url 以确保一切正常。这里是:

http://maps.google.com.br/maps/api/directions/json?origin=rua+cabral+983+Porto+Alegre+RS&destination=travessa+ouvidor+128+Porto+Alegre+RS&sensor=false

有人知道我的代码有什么问题吗?谢谢你的帮助!

4

0 回答 0