ios调用拨打电话功能有3种实现方法,依次代码如下:
//_telephone:要拨打的电话
//直接拨打,结束返回原程序
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",_telephone]]];
//弹框,结束返回原程序
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"telprompt://%@",_telephone]]];
//弹框,结束返回原程序
NSString *str = [NSString stringWithFormat:@"tel:%@",_telephone];
UIWebView * callWebview = [[UIWebView alloc] init];
[callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]];
[self.view addSubview:callWebview];