iOS 拨打电话的两种方式
2013-04-04 17:58
302 查看
第一种方式
NSString *phone = @“88888888”
if (phone != nil) {
NSString *telUrl = [NSString stringWithFormat:@"telprompt:%@",phone];
NSURL *url = [[NSURL alloc] initWithString:telUrl];
[[UIApplication sharedApplication] openURL:url];
}
第二种方式
UIWebView*callWebview =[[UIWebView alloc] init];
NSString *telUrl = [NSString stringWithFormat:@"tel:%@",phone];
NSURL *telURL =[NSURL URLWithString:telUrl];//
貌似tel:// 或者 tel: 都行
[callWebview loadRequest:[NSURLRequest requestWithURL:telURL]];
//记得添加到view上
[self.view addSubview:callWebview];
NSString *phone = @“88888888”
if (phone != nil) {
NSString *telUrl = [NSString stringWithFormat:@"telprompt:%@",phone];
NSURL *url = [[NSURL alloc] initWithString:telUrl];
[[UIApplication sharedApplication] openURL:url];
}
第二种方式
UIWebView*callWebview =[[UIWebView alloc] init];
NSString *telUrl = [NSString stringWithFormat:@"tel:%@",phone];
NSURL *telURL =[NSURL URLWithString:telUrl];//
貌似tel:// 或者 tel: 都行
[callWebview loadRequest:[NSURLRequest requestWithURL:telURL]];
//记得添加到view上
[self.view addSubview:callWebview];
相关文章推荐
- iOS 拨打电话三种方式 和 发短信的两种方法
- IOS程序调用拨打电话的两种方式
- iOS 两种调用拨打电话方式
- iOS两种调用拨打电话方式(亲测)
- iOS--拨打电话--图(两种方式:其中有提示用户是否需要拨打,拨打完后,回到应用程序)
- iOS 拨打电话的两种方式
- IOS 拨打电话的两种方式
- iOS 拨打电话的两种方式
- Android 拨打电话两种方式
- iOS拨打电话的方式
- iOS - 拨打电话的方式总结
- Android笔记:Android 使用Intent拨打电话的两种方式以及差别
- iOS两种方法拨打电话
- iOS 拨打电话三种方式
- ios开发之 调用系统电话方式(两种)
- android基础--拨打电话两种方式
- iOS拨打电话的3种方式(转载)
- iOS 拨打电话代码的三种方式
- 蓝牙耳机拨打电话和VOIP通话两种方式对于上层来说创建SCO过程的区别
- 【原】iOS学习之三种拨打电话方式的比较