【问题标题】:telprompt: allows less characters than the phone itself. Which?telprompt:允许的字符少于电话本身。哪个?
【发布时间】:2012-01-16 17:40:47
【问题描述】:

我正在使用 iPhone 的通讯录使用 telprompt 拨打号码:。带有空格和破折号的数字不起作用,而带有加号和数字的数字只能起作用。 iphone 本身不允许输入它们,但与 mac 同步会得到很多(无效?)电话号码。允许使用哪些字符,为什么?

【问题讨论】:

    标签: iphone addressbook telprompt


    【解决方案1】:

    尝试使用此代码,它只会在电话号码字符串中留下数字:

    NSString* phone = @"477 (38) 232-35-47";
    //@"477 (38) 232-35-47"
    phone = [[phone componentsSeparatedByCharactersInSet:[[NSCharacterSet decimalDigitCharacterSet] invertedSet]] componentsJoinedByString:@""];
    //@"477382323547"
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"telprompt:%@", phone]]];
    

    【讨论】:

      【解决方案2】:

      请参阅RFC 3966: The tel URI for Telephone Numbers 的第 3 节“URI 语法”。

      【讨论】:

      • 所以空格是不允许的,但破折号是。
      猜你喜欢
      • 2018-03-30
      • 2018-02-07
      • 1970-01-01
      • 2022-01-21
      • 2013-02-07
      • 2012-06-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多