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];       

}   


原文地址:https://www.cnblogs.com/zhiqiangsimida/p/2774611.html