iOS判断手机中是否 有 SIM卡---备用
[CTSIMSupportGetSIMStatus() isEqualToString:kCTSIMSupportSIMStatusNotInserted]可以判断是否插入了sim卡。
前提是把下面的代码随便复制到一个头文件里面,然后引入CoreTelephony.framework即可。
extern NSString* c*****t kCTSMSMessageReceivedNotification;
extern NSString* c*****t kCTSMSMessageReplaceReceivedNotification;
extern NSString* c*****t kCTSIMSupportSIMStatusNotInserted;
extern NSString* c*****t kCTSIMSupportSIMStatusReady;
id CTTelephonyCenterGetDefault(void);
void CTTelephonyCenterAddObserver(id,id,CFNotificationCallback,NSString*,void*,int);
void CTTelephonyCenterRemoveObserver(id,id,NSString*,void*);
int CTSMSMessageGetUnreadCount(void);
int CTSMSMessageGetRecordIdentifier(void * msg);
NSString * CTSIMSupportGetSIMStatus();
NSString * CTSIMSupportCopyMobileSubscriberIdentity();
id CTSMSMessageCreate(void* unknow,NSString* number,NSString* text);
void * CTSMSMessageCreateReply(void* unknow,void * forwardTo,NSString* text);
void* CTSMSMessageSend(id server,id msg);
NSString *CTSMSMessageCopyAddress(void *, void *);
NSString *CTSMSMessageCopyText(void *, void *);
extern NSString* c*****t kCTSMSMessageReceivedNotification;
extern NSString* c*****t kCTSMSMessageReplaceReceivedNotification;
extern NSString* c*****t kCTSIMSupportSIMStatusNotInserted;
extern NSString* c*****t kCTSIMSupportSIMStatusReady;
id CTTelephonyCenterGetDefault(void);
void CTTelephonyCenterAddObserver(id,id,CFNotificationCallback,NSString*,void*,int);
void CTTelephonyCenterRemoveObserver(id,id,NSString*,void*);
int CTSMSMessageGetUnreadCount(void);
int CTSMSMessageGetRecordIdentifier(void * msg);
NSString * CTSIMSupportGetSIMStatus();
NSString * CTSIMSupportCopyMobileSubscriberIdentity();
id CTSMSMessageCreate(void* unknow,NSString* number,NSString* text);
void * CTSMSMessageCreateReply(void* unknow,void * forwardTo,NSString* text);
void* CTSMSMessageSend(id server,id msg);
NSString *CTSMSMessageCopyAddress(void *, void *);
NSString *CTSMSMessageCopyText(void *, void *);
posted on 2015-12-12 13:15 🌞Bob 阅读(728) 评论(1) 编辑 收藏 举报