NSString *allString = [NSString stringWithFormat:@"tel:10086"];//注意电话号码不能包含空格,包含空格的电话号码拨打没有反应
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:allString]];
示例:
NSString *num = [[NSString alloc] initWithFormat:@"tel:%@",phone];
num = [num stringByReplacingOccurrencesOfString:@" " withString:@""];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:num]];
时间: 2024-11-10 15:21:14