IOS Main thread Checker:ui API called on a background thread explanation

Source: Internet
Author: User

The following warning appears in the Xcode print bar:

Main thread Checker:ui API called on a background Thread

What is wrong with this?

This is not necessarily a mistake, it can be understood as a warning that he is not a mistake, because it does not necessarily affect your code functionality, and may have no effect on your implementation capabilities.

So the implication is this:

This is a new feature of Xcode 9: The main thread detector (main threads Checker).

When it does, it means that the code that would have been executed in the main thread was executed by you in the sub-thread.

Then we have to solve, just need to check our code, modify it just fine.

Attached to my own error:

I was in the detection status bar direction, did not switch to the main thread processing, so reported this log, modified and then run on OK.

-enjoy~

IOS Main thread Checker:ui API called on a background thread explanation

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.