看起来这应该很简单,但无论出于何种原因,当我按下 UIButton 时,我无法让手机功能提示。
-(IBAction)viewMapButton:(id) sender
{
NSString *phoneNumber = [[NSString alloc] initWithString:@"tel:1234567890"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];
NSLog(@"Call");
}
我的 NSLog 调用成功。我只是在 iOS 模拟器上运行它;这是否导致它不提示调用电话?
谢谢! 跳蚤
最佳答案
iOS 模拟器没有电话(就像 iPod Touch 一样),所以当您调用 tel
URL 方案时什么也不会发生。
关于iphone - UIButton 不执行电话调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9367766/