用户单击xcode 7中的按钮时无法打开拨号程序

时间:2015-10-05 06:37:51

标签: ios xcode

-(IBAction)didSelectButton:(id)sender
{
   NSString *numberString = @"415-592-5909";
   [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel://%@",numberString]]];
}

我有这个代码来打开拨号器,但它在Xcode 7中不起作用。所以当我搜索时我得知我必须将tel url方案列入白名单,所以我在info.plist中做了类似的事情。

<key> LSApplicationQueriesSchemes</key>
<array>
    <string>telprompt</string>
    <string>tel</string>
</array> 

1 个答案:

答案 0 :(得分:1)

您在密钥前添加了一个空格

echo $this->db->last_query(); die();

更新它
<key> LSApplicationQueriesSchemes</key>

希望您收到以下错误:

  

由于未捕获的异常'InvalidOperationException'而终止应用,   原因:您的Info.plist中缺少电话   LSApplicationQueriesSchemes是iOS 9.0'

所必需的

只需更新密钥:

<key>LSApplicationQueriesSchemes</key>

要打开提示,您必须使用<key>LSApplicationQueriesSchemes</key> <array> <string>telprompt</string> <string>tel</string> </array>