一.跳转到QQ聊天
1.UIWebview方式
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero];
NSURL *url = [NSURL URLWithString:@"mqq://im/chat?chat_type=wpa&uin=QQ号码&version=1&src_type=web"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[webView loadRequest:request];
[self.view addSubview:webView];
2.openURL
NSString *qq=[NSString stringWithFormat:@"mqq://im/chat?chat_type=wpa&uin=%@&version=1&src_type=web",@"QQ号码"];
NSURL *url = [NSURL URLWithString:qq];
[[UIApplication sharedApplication] openURL:url];
二.拨打电话
1.UIWebview方式
NSURL *phoneURL = [NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",@"电话号码"]];
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero];// 这个webView只是一个后台的 但是这个方法是合法的
[webView loadRequest:[NSURLRequest requestWithURL:phoneURL]];
[self.view addSubview:webView];
2.openURL
NSURL *phoneURL = [NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",@"电话号码"]];
[[UIApplication sharedApplication] openURL:phoneURL];