Usage of performxxx:
View Toggle:
※ Switch views According to Segue identifier
Performseguewithidentifier: (nsstring *) identifier sender: (ID) sender;
Synchronous execution, regardless of thread, is equivalent to calling the method directly. Use when you need to invoke the method dynamically.
※ Implement a custom method
Performselector: (SEL) Aselector;
※ Delay the execution of a custom method,
Performselector: (SEL) Aselector withobject: (id) obj afterdelay: (nstimeinterval) Delay inmodes: (Nsarray *) modes;
※ Execute a custom method and pass in a parameter
Performselector: (SEL) Aselector withobject: (id) obj;
※ Execute a custom method and pass in two parameters
Performselector: (SEL) Aselector withobject: (ID) obj1 withobject: (ID) obj2;
Related to multi-threaded execution:
※ executing a custom method in a background thread, passing in a parameter
Performselectorinbackground: (SEL) Aselector withobject: (id) obj;
※ Execute a custom method on a thread
Performselector: (SEL) aselector onthread: (nsthread *) thread Withobject: (ID) obj waituntildone: (BOOL) done;
※ Execute a custom method on a thread , pass in an array parameter related to thread Runloop loop execution
Performselector: (SEL) aselector onthread: (nsthread *) thread Withobject: (ID) obj waituntildone: (BOOL) Done modes: ( Nsarray *) modes;
※ Perform a custom method on the main thread
Performselectoronmainthread: (SEL) Aselector withobject: (id) obj waituntildone: (BOOL) done;
※ Perform a custom method on the main thread, passing in an array parameter related to the main thread Runloop loop execution
Performselectoronmainthread: (SEL) Aselector withobject: (id) obj waituntildone: (BOOL) Done modes: (Nsarray *) modes;
Summary of several methods of ios:performxxx: