Summary of several methods of ios:performxxx:

Source: Internet
Author: User

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:

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.