2011-12-24 71 views

回答

4

当然。只要做这样的事情:

NSXMLParser * xmlParser = 
    [[NSXMLParser alloc] initWithContentsOfURL: [NSURL URLWithString: @"http://maps.googleapis.com/maps/api/directions/xml?origin=Toronto,ON&destination=Manhattan,NY&dirflg=r&sensor=false"]; 

Apple documentation for NSXMLParser is here

这可能对您的目的有点太重,所以您也可以做一些类似answers provided for in this duplicate question的事情。

+0

啊,太好了。你碰巧知道为什么'dirflg = r'参数(切换到公共交通)不起作用? – c0d3Junk13 2011-12-24 17:30:20

+0

不是我的头顶,但发布了一个不同的问题,我或其他人可以为你提供一个快速的答案。 – 2011-12-24 19:40:07