你好,歡迎來到IOS教程網

 Ios教程網 >> IOS編程開發 >> IOS開發綜合 >> iOS之解體處置:This application is modifying the autolayout engine from a background thread

iOS之解體處置:This application is modifying the autolayout engine from a background thread

編輯:IOS開發綜合

此文描繪了IOS之解體處置:This application is modifying the autolayout engine from a background thread的相關內容,詳細內容請看上面

一、錯誤提示

明天在開發的時分遇到一個解體問題,“This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes.This will cause an exception in a future release.”如圖所示

IOS之崩潰處理:This application is modifying the autolayout engine from a background thread

三、錯誤緣由

後來察看代碼後發現竟然是在子線程裡更新了UI招致的解體。在我們學習多線程的時分一定會看到一句話:UI一定要在主線程中更新。這就是招致解體的次要緣由,寫代碼GCD相關的代碼一定切記更新UI的操作一定要放在主線程操作。

四、處理辦法

既然知道了要在主線程更新UI,那麼只需求在原來的代碼裡加上這段代碼:

IOS之崩潰處理:This application is modifying the autolayout engine from a background thread

【iOS之解體處置:This application is modifying the autolayout engine from a background thread】的相關資料介紹到這裡,希望對您有所幫助! 提示:不會對讀者因本文所帶來的任何損失負責。如果您支持就請把本站添加至收藏夾哦!

  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved