Detailed description of iOS multi-thread Nsthread header file

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.