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

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

}   


posted on 2012-10-16 11:05  一位程序猿  阅读(130)  评论(0)    收藏  举报