iOS拨打电话的2种方式

方式一:直接拨打,不提示

NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"13800138000"];

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


方式二:先提示

NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"13800138000"];

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

    [callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]];

    [self.view addSubview:callWebview];



你可能感兴趣的:(iOS拨打电话的2种方式)