// 拨打电话方法1 直接拨打电话,打完电话后留在通讯录(ios8好像是回到app)
NSMutableString * str=[[[NSMutableString alloc] initWithFormat:@"tel:%@",phoneNumber] autorelease];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
// 拨打电话方法2 再弹一次提示,打完电话后可以返回程序
UIWebView *callWebView = [[UIWebView alloc] init];
NSURL *telURL = [NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",phoneNumber]];
[callWebView loadRequest:[NSURLRequest requestWithURL:telURL]];
[self.view addSubview:callWebView];
[callWebView release];
// 拨打电话方法3 会回去到原来的程序⾥里(注意这⾥里的telprompt),也会弹出提⽰,(审核通不过)
NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"telprompt://%@",@"186xxxx6979"
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]]
// 如果电话号码是多个
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"电话下单"
message:nil
delegate:self
cancelButtonTitle:@"取消"
otherButtonTitles:nil];
for (int i = 0; i < _phones.count; i++){
[alert addButtonWithTitle:[_phones objectAtIndex:i]];
}
alert.tag = 111;
[alert show];
[alert release];