How to add “Directions To Here” button into the address book?

倾然丶 夕夏残阳落幕 提交于 2019-12-01 13:58:29
"http://maps.google.com/maps?daddr=%f,%f&saddr=%f,%f",userLatitude,userLongitude,targetLatitude,targetLongitude


-(void)goToMaps{

[[UIApplication sharedApplication]openURL:url];//the url i gave you above
NSLog(@"the URL for directions is %@", [url absoluteString]);

}
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {

if (indexPath.row == x) {//whatever row in the table it is on
    [self goToMaps];
}

}

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!