拨打电话

方法一:不弹出提示框,直接拨打

NSMutableString *str=[[NSMutableStringalloc]initWithFormat:@"tel:%@",@"电话号码"];

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];

方法二:弹出提示框

UIWebView * callWebview = [[UIWebView alloc] init];

[callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"tel:10010"]]];

[[UIApplication sharedApplication].keyWindow addSubview:callWebview];

你可能感兴趣的:(拨打电话)