简体   繁体   English

从iPhone OS 3.0呼叫的代码不起作用?

[英]code for calling from iphone os 3.0 not working?

NSString *StrPhoneNo = @"(21) 2197-78797"; NSString * StrPhoneNo = @“(21)2197-78797”;

[[UIApplication sharedApplication] openURL:
      [NSURL URLWithString:[NSString stringWithFormat:@"tel:%@", StrPhoneNo]];

This is not working? 这不行吗?

The phone number doesn't look correct to me. 电话号码对我来说似乎不正确。 I don't know where you're located, but I guess you need a 0 or 1 in front of the phone number. 我不知道您的位置,但我想您需要在电话号码前加0或1。 Or if it's an international number, add a "+" in front of the country code. 或者,如果是国际号码,请在国家/地区代码前面添加“ +”。

In my code I'm calling "+353876543210" and it's working fine. 在我的代码中,我叫“ +353876543210”,它工作正常。 So I guess the phone number is in the wrong format. 因此,我猜电话号码格式错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM