首页 > 代码库 > iOS 打电话Demo

iOS 打电话Demo

#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];
}

iOS 打电话Demo