What is the 12-runloop of the iOS face test?

Source: Internet
Author: User
iOS face Test 12-runloop is what. Runloop is literally the meaning of running loops, which is not bad, it is indeed a concept of the loop, or exactly the loop in the thread. Some programs are a circle, this circle is essentially the so-called runloop, is a cycle, but this cycle to add a lot of features.
First of all, the beginning of the loop body needs to detect whether there is a need to deal with the event, if there is to deal with, if not then go to sleep to save CPU time.
The Run loop is equivalent to the Win32 message loop mechanism, which lets you schedule whether a thread is busy or idle based on event/message (mouse, keyboard, timer, etc.).
The system automatically mechanical engineer the application's main line into a corresponding run loop to handle its message loop.
The ability to fire touchesbegan/touchesmoved and so on when touching uiview is invoked,
This is because the main thread of the application has such a run loop in the Uiapplicationmain to distribute input or timer events.


Reference article: Automatic release pools (Autorelease pool) and Runloop
Related Article

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.