Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios4 使用应用程序中的格式化号码拨打电话_Ios4 - Fatal编程技术网

Ios4 使用应用程序中的格式化号码拨打电话

Ios4 使用应用程序中的格式化号码拨打电话,ios4,Ios4,我想从我的应用程序中得到一些关于打电话的帮助。电话号码的格式为(########-## 在my.h中,我有以下内容: IBOutlet UITextView *PhoneNumber; 在我的.m中,我尝试了以下方法: - (IBAction)callPhone:(id)sender [[UIApplication sharedApplication] openURL: [NSURL URLWithString:[NSString stringWithFormat

我想从我的应用程序中得到一些关于打电话的帮助。电话号码的格式为(########-##

在my
.h
中,我有以下内容:

 IBOutlet UITextView    *PhoneNumber;
在我的
.m
中,我尝试了以下方法:

- (IBAction)callPhone:(id)sender 

    [[UIApplication sharedApplication] openURL:
     [NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",PhoneNumber.text]]]; 
我拨不出这个号码。但当我试着这样做的时候,它起了作用

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:#########"]];

根据网站,破折号应该是可以的。只需删除括号。

根据站点,破折号应该可以。去掉括号。

我认为空格也是一个问题。我认为空格也是一个问题。