// 这种方式 拨打完电话回不到原来的应用,会停留在通讯录里,而且是直接拨打,不弹出提示
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:telString]];
// 下面两种方法,打完电话后还会回到原来的程序,也会弹出提示
NSString* telString = [[NSString alloc] initWithFormat:@"tel:%@",@"186xxxx6979"];
UIWebView* callWebview = [[UIWebView alloc] init];
[callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:telString]]];
[self.view addSubview:callWebview];
NSString* telString = [[NSString alloc] initWithFormat:@"telprompt:%@",@"186xxxx6979"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:telString]];
注意:
iOS10之后建议使用openURL:options:completionHandler:方法调用URL
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://186xxxx6979"] options:@{} completionHandler:^(BOOL success) { }];