UIApplication没有启动拨打电话

BOM*_*MEz 2 iphone xcode cocoa-touch

我有这个代码:

NSString *telURL = [NSString stringWithFormat:@"tel:1-%@",((UIButton*) sender).titleLabel.text];
telURL = [telURL stringByReplacingOccurrencesOfString:@"\n" withString:@""];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:telURL]];
Run Code Online (Sandbox Code Playgroud)

但它没有启动拨号器应用程序拨打电话.

我检查了字符串telURL,其内容是:"tel:[删除]",据我所知,这是它需要的.

有任何想法吗?

编辑:如果它很重要我刚刚在模拟器上运行它.几天我不会有物理设备.(从下面的答案显然它确实很重要)

Mat*_* S. 12

你是在自问自答.tel:URL不适用于iPhone模拟器和iPod Touch(当然还有iPad).它只适用于iPhone.