IOS Crash handling: This application is modifying the autolayout engine from a background thread, modifying

Source: Internet
Author: User

IOS Crash handling: This application is modifying the autolayout engine from a background thread, modifying

I. error message

This application is modifying the autolayout engine from a background thread, which can lead to engine Crash uption and weird crashes. this will cause an exception in a future release."

Ii. Incorrect writing

Let's take a look at the code writing ,:

Iii. Cause of error

Then I observed the code and found that the crash was caused by updating the UI in the Child thread. When we learn multithreading, we will certainly see a sentence: the UI must be updated in the main thread. This is the main cause of the crash. To write code related to GCD, remember that UI update operations must be performed in the main thread.

Iv. Solution

Now that you know that you want to update the UI in the main thread, you only need to add this code in the original code:

 

 

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.