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.