I want to create contacts app. How can I make a phone call with a button inside a custom UITableViewCell
?
This is my code. It works only the first time when I press call button. When I NSLog
it, it gives me a contact number. When I tap on the button, but don't show dialog box.
NSString *phoneStr = [[NSString alloc] initWithFormat:@"tel://%@",[contactNumbersArray objectAtIndex:indexPath.section]];
NSLog(@"%@", [contactNumbersArray objectAtIndex:indexPath.section]);
UIApplication *application = [UIApplication sharedApplication];
[application openURL:[NSURL URLWithString: phoneStr] options:@{} completionHandler:nil];