我使用这个代码打开地图应用程序
@H_404_2@NSString* versionNum = [[UIDevice currentDevice] systemVersion];
NSString *nativeMapScheme = @"maps.apple.com";
if ([versionNum compare:@"6.0" options:NSNumericSearch] == NSOrderedAscending){
nativeMapScheme = @"maps.google.com";
}
NSString* url = [NSString stringWithFormat:@"http://%@/maps?ll=%f,%f",nativeMapScheme,40.739490,-73.991154];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
解决方法
如果您希望将引脚放置在Apple的Google Maps应用程序上,请在URL中使用“q”而不是“ll”.
你可以这样使用
@H_404_2@NSString* url = [NSString stringWithFormat:@"http://%@/maps?q=%f,-73.991154];