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

后端 未结 1 1913
自闭症患者
自闭症患者 2021-01-16 17:03

Google Map App has \"directions to here\" and \"directions from here\" like http://static.intomobile.com/wp-content/uploads/2008/10/iphone-22-os-google-maps-street-view-23.p

1条回答
  •  梦毁少年i
    2021-01-16 17:43

    "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];
    }
    

    }

    0 讨论(0)
提交回复
热议问题