通过编程方式检测iPhone中是否有Sim卡可用 [英] Detect if Sim Card is available in iPhone programmatically

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

问题描述

您好我正在使用SMSComposer并希望通过地址簿向联系人发送短信。我想检测我的iPhone是否有SIM卡

Hi I am Working on SMSComposer and want to send SMS to Contacts from Address Book.I want to detect whether my iPhone has SIM Card in it or not

是有什么方法我可以达到这个目的。?

Is there any way i can reach this.?

我尝试过REachability Classes,但是它提供了有关WWAN和互联网连接的信息。核心电话框架有这样的设施。
类似于iPhone的运营商NAme等。??

I tried REachability Classes but it gives you information about WWAN and internet Connectivity.Does Core Telephony Framework has such Facility.? Something Like Carrier NAme etc for iPhone.??

任何帮助都将不胜感激。
谢谢
Vikas

Any help would be appreciated. Thanks Vikas

推荐答案

为此你需要添加MessageUI.framework框架...

For this purpose you need to add MessageUI.framework framework...

试试这段代码...它可以帮到你

Try this code...It may help you

Class messageClass = (NSClassFromString(@"MFMessageComposeViewController"));
if([messageClass canSendText]){
    // Sim available
}
else{
    //Sim not available
}

这篇关于通过编程方式检测iPhone中是否有Sim卡可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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