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

}   


posted @ 2012-10-16 11:05  志强思密达  阅读(162)  评论(0编辑  收藏  举报