iphone - UIButton 不执行电话调用

标签 iphone objective-c

看起来这应该很简单,但无论出于何种原因,当我按下 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/

相关文章:

ios - CoreData 不跨多个 iOS 设备存储数据

ios - 了解后台任务执行语法和 GCD

iphone - 如何知道controller是在presentModalViewController中还是在pushViewController中?

iOS UIView 动画取消不起作用

iphone - 将 "open with"菜单集成到我的 iPhone 应用程序中

ios - 我们什么时候使用saveAccount :(ACAccount *)account of ACAccountStore class?

ios - 有关推送到新 DetailView 的信息

iphone - "Plugin handled load"在 UIWebView 的网页中播放视频时出现对话框

iphone - 更改 EntryElement 键盘 returnkeytype monotouch.dialog

iphone - 为分组的 UITableViewCell 自定义选定的背景颜色