iOS 打电话Demo

时间:2014-09-11 09:41:52   收藏:0   阅读:284
#pragma mark - AddressBookCellDelegate
- (void)didClickCallButtonAtIndexPath:(NSIndexPath *)indexPath
{
    //可以实现拨打前弹出提示。并且拨打完以后会回到原来的应用
        NSDictionary *dic = self.names[self.titles[indexPath.section]][indexPath.row];
	NSString *phone = dic[@"phoneNumber"];
	NSString *str=[NSString stringWithFormat:@"tel:%@", phone];
	UIWebView *callWebview = [[UIWebView alloc] init];
	[callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]];
	[self.view addSubview:callWebview];
	[callWebview release];
}

原文:http://blog.csdn.net/mhtios/article/details/39201749

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!