【发布时间】:2016-02-22 15:30:37
【问题描述】:
我正在尝试使用谷歌地图获取方向。 我正在关注这个链接 https://developers.google.com/maps/documentation/ios-sdk/urlscheme?hl=en
和代码:
if ([[UIApplication sharedApplication] canOpenURL:
[NSURL URLWithString:@"comgooglemaps://"]]) {
NSString *temp=@"comgooglemaps://?saddr=Google+Inc,+8th+Avenue,+New+York,+NY&daddr=John+F.+Kennedy+International+Airport,+Van+Wyck+Expressway,+Jamaica,+New+York&directionsmode=transit";
[[UIApplication sharedApplication] openURL:
[NSURL URLWithString:temp]];
} else {
NSLog(@"Can't use comgooglemaps://");
}
地图没有打开,我得到了:
安装[2918:1295695] -canOpenURL:URL 失败:“comgooglemaps://” - 错误:“(null)”
出了什么问题?我错过了什么吗?
我想从我的应用程序中显示谷歌地图。
【问题讨论】:
标签: ios objective-c google-maps