iOS 拨打电话的方法总结
2015-11-16 22:07
465 查看
最近要做 iOS拨打电话的功能, 先攒着……
1 . 这种方法,拨打完电话回不到原来的应用,会停留在通讯录里,而且是直接拨打,不弹出提示
2 . 这种方法,打完电话后还会回到原来的程序,也会弹出提示,推荐这种
3 . 这种方法也会回去到原来的程序里(注意这里的telprompt, apple 官方文档中没有出现过 telprompt),也会弹出提示
1 . 这种方法,拨打完电话回不到原来的应用,会停留在通讯录里,而且是直接拨打,不弹出提示
NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"110"]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
2 . 这种方法,打完电话后还会回到原来的程序,也会弹出提示,推荐这种
NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"110"]; UIWebView * callWebview = [[UIWebView alloc] init]; [callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]]; [self.view addSubview:callWebview]; [callWebview release]; [str release];
3 . 这种方法也会回去到原来的程序里(注意这里的telprompt, apple 官方文档中没有出现过 telprompt),也会弹出提示
NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"telprompt://%@",@"110"]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
相关文章推荐
- ios自动布局(1)
- iOS经典讲解之实现扫描二维码ZBarSDK的使用
- iOS平台基于KVC的JSON与数据对象绑定
- iOS--NSURLSession
- iOS开发:使用Block在两个界面之间传值
- iOS实现一个颜色渐变的弧形进度条
- ios9的新特性
- 对iOS的主要框架的介绍
- iOS宏定义
- iOS图文混排
- iOS 数字格式化(手机号码 银行卡号 格式化,验证码输入控制)
- cocoapods卡屏问题
- iOS开发中@property的属性weak nonatomic strong readonly
- iOS开发中的Git流程
- 一步步调试解决iOS内存泄漏
- 蓝懿iOS 技术内容交流和学习心得 11.16
- iOS另类的内存管理
- iOS本地通知和远程通知
- 【11/16】 iOS开发成长之路,【NSString 和NSInteger的相互转换,NSString字符串比较,拆分】
- #在蓝懿学习iOS的日子#day20