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: