• iOS 拨打电话三种方式


     1 1,这种方法,拨打完电话回不到原来的应用,会停留在通讯录里,而且是直接拨打,不弹出提示
     2  NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"186xxxx6979"];
     3     //            NSLog(@"str======%@",str);
     4 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
     5     
     6 
     7 2,这种方法,打完电话后还会回到原来的程序,也会弹出提示,推荐这种
     8 NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"186xxxx6979"];
     9     UIWebView * callWebview = [[UIWebView alloc] init];
    10     [callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]];
    11     [self.view addSubview:callWebview];
    12     [callWebview release];
    13     [str release];
    14 
    15 
    16 
    17 
    18 3,这种方法也会回去到原来的程序里(注意这里的telprompt),也会弹出提示
    19  NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"telprompt://%@",@"186xxxx6979"];
    20     //            NSLog(@"str======%@",str);
    21     [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
  • 相关阅读:
    继承
    对象和封装
    类的无参、带参方法
    类和对象
    数组
    循环结构
    选择结构
    变量、数据类型和运算符
    快捷键
    MyEclipse与JDK的配置
  • 原文地址:https://www.cnblogs.com/-yun/p/7464751.html
Copyright © 2020-2023  润新知