To determine whether the iPhone has a SIM card, refer to the systemconfigure framework tutorial on the official website of Apple to copy the following code to the header file.
Extern NSString * const kctsmessagereceivednotification;
Extern NSString * const kctsmessagereplacereceivednotification;
Extern NSString * const kctsimsuppsimsimstatusnotinserted;
Extern NSString * const kctsimsuppsimsimstatusready;
Id CTTelephonyCenterGetDefault (void );
Void CTTelephonyCenterAddObserver (id, id, CFNotificationCallback, NSString *, void *, int );
Void CTTelephonyCenterRemoveObserver (id, id, NSString *, void *);
Int ctsmessagegetunreadcount (void );
Int ctsmessagegetrecordidentifier (void * msg );
NSString * CTSIMSupportGetSIMStatus ();
NSString * ctsimsuppcopycopymobilesubscriberidentity ();
Id ctsmessagecreate (void * unknow/* always 0 */, NSString * number, NSString * text );
Void * ctsmessagecreatereply (void * unknow/* always 0 */, void * forwardTo, NSString * text );
Void * ctsmessagesend (id server, id msg );
NSString * ctsmessagecopyaddress (void *, void *);
NSString * ctsmessagecopytext (void *, void *);
Then, CoreTelephony. framework is introduced to use [ctsimsuppgetgetsimstatus () isEqualToString: kctsimsuppsimsimstatusnotinserted] for determination.