1, Nsthread header file related method//get current thread + (Nsthread *) CurrentThread; Auto-start thread + (void) Detachnewthreadselector after thread creation: (SEL) selector totarget: (ID) target withobject: (ID) argument;//is multithreaded + ( BOOL) ismultithreaded;//Thread Dictionary-(nsmutabledictionary *) threaddictionary;//thread sleeps to what time + (void) Sleepuntildate: (NSDate *) How long date;//thread sleeps + (void) Sleepfortimeinterval: (nstimeinterval) ti;//exit thread + (void) exit;//thread priority + (double) threadpriority;+ (BOOL) SetThreadPriority: (double) p;-(double) threadpriority ns_available (10_6, 4_0);-(void) SetThreadPriority: ( Double) p ns_available (10_6, 4_0);//Call stack return address + (Nsarray *) callstackreturnaddresses ns_available (10_5, 2_0); + (Nsarray *) Callstacksymbols ns_available (10_6, 4_0);//Set thread name-(void) SetName: (NSString *) n ns_available (10_5, 2_0);-(NSString *) Name Ns_available (10_5, 2_0);//Gets the size of the stack-(Nsuinteger) stackSize ns_available (10_5, 2_0);-(void) Setstacksize: ( Nsuinteger) s ns_available (10_5, 2_0);//is the main thread-(bool) Ismainthread ns_available (10_5, 2_0); + (bool) Ismainthread Ns_ AVAILABLE (10_5, 2_0); Reports WhethEr current thread is main+ (Nsthread *) Mainthread ns_available (10_5, 2_0);-(ID) init ns_available (10_5, 2_0);//designated initializer-(ID) Initwithtarget: (ID) Target selector: (SEL) Selector object: (ID) argument ns_available (10_5, 2_0);// Whether it is executing-(BOOL) isexecuting ns_available (10_5, 2_0);//Whether execution is complete-(bool) isfinished ns_available (10_5, 2_0);//whether to cancel thread-(BOOL) IsCancelled ns_available (10_5, 2_0);-(void) Cancel ns_available (10_5, 2_0);//thread Start-(void) Start ns_available (10_5, 2_0) ;-(void) main ns_available (10_5, 2_0);//thread body method@end//Multithreading notification foundation_export NSString * const Nswillbecomemultithreadednotification; Foundation_export NSString * Const nsdidbecomesinglethreadednotification; Foundation_export NSString * Const nsthreadwillexitnotification; @interface nsobject (nsthreadperformadditions)// Communication with main thread-(void) Performselectoronmainthread: (SEL) Aselector withobject: (ID) arg waituntildone: (BOOL) wait modes: ( Nsarray *) array;-(void) Performselectoronmainthread: (SEL) Aselector withobject: (ID) arg waituntiLdone: (BOOL) wait;//equivalent to the first method with kcfrunloopcommonmodes//communication with other sub-threads-(void) Performselector: (SEL) Aselector onthread: (Nsthread *) THR Withobject: (ID) arg waituntildone: (BOOL) Wait modes: (Nsarray *) array ns_available (10 _5, 2_0);-(void) Performselector: (SEL) aselector onthread: (Nsthread *) THR Withobject: (ID) arg waituntildone: (BOOL) wait Ns_available (10_5, 2_0);//equivalent to the first method with kcfrunloopcommonmodes//implicitly creates and starts a thread-(void) Performselectorinbackground: (SEL) Aselector withobject: (ID) arg ns_available (10_5, 2_0);
Detailed description of iOS multi-thread Nsthread header file