看完这篇文章,Programmatically open Maps app in iOS 6
使用下面的代码,我启动了 Apple Maps,但我只想打开 Apple Maps,而不是向它发送地址、地点标记或方向。
CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(44.180383, -75.229618);
MKPlacemark *placemark = [[MKPlacemark alloc] initWithCoordinate:coordinate
addressDictionary:nil];
MKMapItem *mapItem = [[MKMapItem alloc] initWithPlacemark:placemark];
[mapItem setName:@"Home"];
// Pass the map item to the Maps app
[mapItem openInMapsWithLaunchOptions:nil];
如有任何帮助,我们将不胜感激。
最佳答案
在应用程序中使用以下代码仅打开 Apple map
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://maps.apple.com/?q="]];
关于ios - 以编程方式启动没有方向或地点标记的 Apple map ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34782434/