【问题标题】:isoCountryCode in CTCarrier not returning nil when in Airplane Mode在飞行模式下,CTCarrier 中的 isoCountryCode 不返回 nil
【发布时间】:2018-11-30 06:55:06
【问题描述】:

我在 iPhone 6 (iOS 11.4.1) 的 CTCarrier 中使用 isoCountryCode。插入 SIM 并打开飞行模式时,如果 isoCountryCode 返回为“in”的值。

根据Apple Docs,如果以下任何一项适用,则此属性的值为nil

  • 设备处于飞行模式。 (在我的情况下有效)
  • 设备中没有 SIM 卡。
  • 设备不在蜂窝网络服务范围内。

需要帮助才能知道我是否正确理解了文档。如果是,那么为什么我在飞行模式下将 isoCountryCode 设为“in”?


我已针对此问题向 Apple 提交了错误。

https://bugreport.apple.com/web/?problemID=47138150

【问题讨论】:

标签: ios iphone swift ios11


【解决方案1】:

是的,你理解正确。 isoCountryCode 在飞行模式下应该为 nil。

【讨论】:

  • 那么为什么我在飞行模式打开时将 isoCountryCode 显示为“in”?
【解决方案2】:

在这种情况下,Apple Docs 不够清楚。 isoCountryCode 在您漫游时不会改变。这意味着操作系统应该只获取一次您的运营商代码。手机飞行模式打开时插入新SIM卡可能为零。我不是该领域的专家,但很可能 SIM 可以保存与国家/地区静态链接的 MCC/MNC 代码。一些测试:https://stackoverflow.com/a/5829063/1980246

【讨论】:

    猜你喜欢
    • 2014-05-21
    • 2018-05-02
    • 2019-04-02
    • 1970-01-01
    • 1970-01-01
    • 2014-09-14
    • 2016-12-21
    • 1970-01-01
    • 2016-08-29
    相关资源
    最近更新 更多