读书人

iphone开发中调用系统通电话功能

发布时间: 2012-07-04 19:33:55 作者: rapoo

iphone开发中调用系统打电话功能

?

?

iphone开发中调用打电话功能,一般有2种:


1、系统的打电话代码,不返回当前程序:

?

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://1008611"]];

?

2、用UIWebView来实现,打电话结束后会返回当前应用程序:

?

UIWebView *callPhoneWebVw = [[UIWebView alloc] init];    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"tel://1008611"]];    [callPhoneWebVw loadRequest:request];
?

?

第2种会弹出一个alert对话框,点击“呼叫”按钮后即可拨打电话。

?

?

?

?

读书人网 >Iphone

热点推荐