• IOS之拨打电话的三种方式


    // 1,这种方法,拨打完电话回不到原来的应用,会停留在通讯录里,而且是直接拨打,不弹出提示

       NSMutableString * str1=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"13913013703"];

                NSLog(@"str======%@",str);

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

        

       //2,这种方法,打完电话后还会回到原来的程序,也会弹出提示,推荐这种

        NSMutableString * str2=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"13913013703"];

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

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

        [self.view addSubview:callWebview];

        [callWebview release];

       [str release];

       

     

       //3,这种方法也会回去到原来的程序里(注意这里的telprompt),也会弹出提示

        NSMutableString * str3=[[NSMutableString alloc] initWithFormat:@"telprompt://%@",@"13913013703"];                 

        NSLog(@"str======%@",str);

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

  • 相关阅读:
    【设计模式】——抽象工厂模式
    【设计模式】——观察者模式
    Candy
    Two Sum
    Interleaving String
    Longest Valid Parentheses
    【设计模式】——建造者模式
    【设计模式】——外观模式
    Simplify Path
    Word Search
  • 原文地址:https://www.cnblogs.com/zhufeng1994/p/4708511.html
Copyright © 2020-2023  润新知