iPhone - 检测SIM卡可用性 [英] iPhone - Detecting SIM card availability

查看:260
本文介绍了iPhone - 检测SIM卡可用性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用本主题中的答案。 iPhone - 如何确定运营商设备(AT& T,Verizon等?)相同在iphone中获取操作员详细信息。虽然使用SIM卡时工作正常,但如果没有SIM卡,则返回的运营商名称是旧的运营商名称。它没有检测到SIM被移除。

I am using the answer in this topic. iPhone - how to determine carrier of the device (AT&T, Verizon, etc?) which is the same as getting operator details in iphone. Although it works fine when using a sim card, the returned carrier name if there is no SIM card is the old carrier name. It doesn't detect that the SIM is removed.

我知道这与Apple文档相矛盾,如果没有载体,CTCarrier对象应为零。但在我的应用程序中,我记录了运营商信息,它给了我最新的运营商名称,虽然没有安装SIM卡。

I know this contradicts with Apple documentation that if there is no carrier, CTCarrier object shall be nil. But in my app I logged the carrier info and it gives me the latest carrier name although no sim is installed.

推荐答案

根据文档 [CTCarrier carrierName]


如果配置设备对于运营商然后移除SIM卡,
此属性保留了运营商的名称。

If you configure a device for a carrier and then remove the SIM card, this property retains the name of the carrier.

就我而言知道,您无法检测SIM卡是否已安装。您只能使用 Reachability <确定是否可以使用WWAN连接/ code>

As far as I know, you cannot detect if the SIM card is installed. You can only determine if a WWAN connection is available using Reachability.

这篇关于iPhone - 检测SIM卡可用性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆