要打开带有方向的 Google 地图,我在 NSURL 中使用了格式化的 NSString。但它不适用于 [[UIApplication sharedApplication] openURL:nsurl];
代码:
NSString * directionsURL = [NSString stringWithFormat:@"http://maps.google.com/maps?daddr=%@&saddr=%@", @"Hartenseweg 16, Renkum", @"1 Infinte Loop, Cupertino"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:directionsURL]];