• iphone开发 拨打电话


    废话不多说,直接上代码:

    + (void) makeCall:(NSString *)phoneNumber   
    
    {   
    
        if ([DeviceDetection isIPodTouch]){   
    
            [UIUtils alert:kCallNotSupportOnIPod];   
    
            return;   
    
        }           
    
        NSString* numberAfterClear = [UIUtils cleanPhoneNumber:phoneNumber];              
    
        NSURL *phoneNumberURL = [NSURL URLWithString:[NSString stringWithFormat:@"tel:%@", numberAfterClear]];   
    
        NSLog(@"make call, URL=%@", phoneNumberURL);   
    
        [[UIApplication sharedApplication] openURL:phoneNumberURL];       
    
    }   


  • 相关阅读:
    selenium 难定位元素、时间插件
    列表生成式
    三元表达式
    监控日志
    非空即真
    深拷贝浅拷贝
    元组
    list字典嵌套
    2021
    布尔类型
  • 原文地址:https://www.cnblogs.com/zhiqiangsimida/p/2774611.html
Copyright © 2020-2023  润新知