[英]Xcode iOS: Calling a number from the app
I across the following code: 我跨过以下代码:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://8005551212"]];
on : Making phone calls on iPhone on: 在iPhone上拨打电话
But, it does not work for me in the simulator. 但是,它在模拟器中对我不起作用。 I have connected the IBAction(callphone) to the ViewController(TouchUpInside).
我已经将IBAction(通话电话)连接到ViewController(TouchUpInside)。 I am now not sure, is it because I am checking my code in simulator?
我现在不确定,是因为我正在模拟器中检查代码吗? I do not get a dialog box.
我没有对话框。 Please advice.
请指教。
I tried putting log statements and the action does get called since the log stamtments that I wrote to test is being printed 我尝试放置日志语句,但由于打印了我编写的要测试的日志记录,因此确实调用了该操作
Can you make a phone call from your Mac? 您可以从Mac拨打电话吗? No. That's why the simulator doesn't work when you try to open a
tel://
URL. 不。这就是为什么当您尝试打开
tel://
URL时模拟器无法正常工作的原因。 You must do this from a device that can make a call: an iPhone, but not an iPad or iPod touch. 您必须在可以拨打电话的设备上执行此操作:iPhone,但不能拨打iPad或iPod touch。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.