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 *);

上一篇:linux命令:压缩解压打包工具大集合


下一篇:自己封装Linux命令行万能解压命令