我有的代码。顺便说一句,我无法接听上班电话,网站也无法打开!
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *urlToOpen = @"";
if( indexPath.section == 0 ){
// call number
urlToOpen = @"tel:442074036933";
} else if( indexPath.section == 1 ){
// open website
urlToOpen = @"http://www.designmuseum.org";
} else {
// open address
urlToOpen = @"http://maps.apple.com/maps?daddr=Design+Museum+London";
}
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlToOpen]];
NSString *destinationAddress = [NSString stringWithFormat:@"%@+%@+%@",
[address street],
[address city],
[address country]];
NSString *sourceAddress = [LocalizedCurrentLocation currentLocationStringForCurrentLanguage];
NSString *url = [NSString stringWithFormat:@"http://maps.apple.com/maps?saddr=%@&daddr=%@",
[sourceAddress stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding],
[destinationAddress stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
我需要为我的应用添加目标地址 = 28 Shad Thames, London, United Kingdom。用什么格式写?因为我无法让它工作并且真的需要快速解决我的应用程序的这个问题