我有一些代码尝试在应用程序中进行调用,但它似乎没有工作:
UIApplication *myApp = [UIApplication sharedApplication];
NSString *theCall = [NSString stringWithFormat:@"tel://%@",phone];
NSLog(@"making call with %@",theCall);
[myApp openURL:[NSURL URLWithString:theCall]];
Run Code Online (Sandbox Code Playgroud)
有时,变量phone就是这样的@"(102) 222-2222".如何使用这样的电话号码拨打电话?我是否需要手动从中提取数字并摆脱所有额外的标点符号?