无法parsing来自谷歌的json响应

我正试图从这个URLparsingJson响应。 我已经使用了SBJsonParser,MTJSON和另一个parsing器,但是我在这三种情况下都得到了NULL。

apiUrlStr = @"http://maps.google.com/maps?output=dragdir&saddr=Delhi&daddr=Mumbai+to:hyderabad"; NSURL* apiUrl = [NSURL URLWithString:apiUrlStr]; NSString *apiResponse = [NSString stringWithContentsOfURL:apiUrl encoding:NSUTF8StringEncoding error:nil]; SBJsonParser *json = [[[SBJsonParser alloc] init] autorelease]; NSDictionary *dictionary = [json objectWithString:apiResponse]; NSLog(@"dictionary=%@", [json objectWithString:apiResponse]); 

2011-12-09 16:59:01.226 MapWithRoutes [2523:207] dictionary =(null)

Plzbuild议我一些东西

Oke如果检查了您使用JSONlint.com提供的url,并且JSON无效。 因此不能被任何库parsing。

如果你使用JSONkit,你可以提供一个parsing调用的NSError对象来查看错误:

 NSError *error = nil; NSDictionary *dictionary = [apiResponse objectFromJSONStringWithParseOptions:JKParseOptionNone error:&error]; if (!dictionary) { NSLog(@"Error: %@", error); }