拨打电话
NSString *callPhone = [NSString stringWithFormat:@"telprompt://%@",@"10086"];
CGFloat version = [[[UIDevice currentDevice]systemVersion]floatValue];
if (version >= 10.0) {
/// 大于等于10.0系统使用此openURL方法
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone] options:@{} completionHandler:nil];
} else {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone]];
}
或
NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"10086"];
UIWebView * callWebview = [[UIWebView alloc] init];
[callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]];
[self.view addSubview:callWebview];
网友评论