1.打电话
//1,这种方法也会回去到原来的程序里(注意这里的telprompt),也会弹出提示
- (IBAction)buttonClick:(id)sender {
[[UIApplicationsharedApplication]openURL:[NSURLURLWithString:@"telprompt://183****6729"]];
}
//2,这种方法,打完电话后还会回到原来的程序,也会弹出提示,推荐这种
- (IBAction)buttonClick2:(id)sender {
NSMutableString * str=[[NSMutableStringalloc]initWithFormat:@"tel:%@",@"183****6729"];
UIWebView * callWebview = [[UIWebViewalloc]init];
[callWebview loadRequest:[NSURLRequestrequestWithURL:[NSURLURLWithString:str]]];
[self.viewaddSubview:callWebview];
}
2发短信
//发短信最简单是使用openURL:
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"sms://10010"]];//发短信
3发邮件
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"mail://hello@hello.com"]];