This has been really driving me crazy. Web links work fine, but a phone number (I have tried a zillion combinations) do NOT work from my UIWebView. Any help MOST appreciated. Here's 3 more ways to do it. And none of them will dial a phone number.
- (void)viewDidLoad {
[super viewDidLoad];
CGRect webRect = CGRectMake(0.0f, 0.0f, 320.0f, 368.0f);
myWebView = [[UIWebView alloc] initWithFrame:webRect];
myWebView.backgroundColor = [UIColor clearColor];
[myWebView setOpaque:NO];
[[self myWebView] setDelegate:self];
NSString *htmlContent = [NSString stringWithFormat:
@"<html>"
"<body>"
"212-555-1212<br>"
"<a href=tel://212-555-1212>212-555-1212</a><br>"
"<a href=alo://212-555-1212>212-555-1212</a><br>"
"</body>"
"</html>"];
NSURL *baseURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] resourcePath]];
[myWebView loadHTMLString:htmlContent baseURL:baseURL];
[self.view addSubview:myWebView];
[myWebView release];
}