【发布时间】:2011-08-10 12:38:10
【问题描述】:
我想让一个按钮呼叫用户在文本字段中输入的电话号码。我有一个代码,但它不起作用。
NSString * phoneNumber = [NSString stringWithFormat:@"%@%@", @"tel://", phoneNumber.text];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];
有人有类似的方法吗?谢谢。
【问题讨论】:
-
只是一个问题,你是在设备还是模拟器上尝试。
-
@Hadi:哈,好电话。他可能只是在模拟器上使用它。 ;)
标签: iphone cocoa-touch