天天看點

This application is modifying the autolayout engine from a background thread, which can lead

項目中遇到一個跳轉問題,延時(等待時間)特别久,并且報下面的的提示警告

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.
           
This application is modifying the autolayout engine from a background thread, which can lead

問題原因:

問題的原因是因為在子線程中重新整理了UI,解決辦法是,回到主線程中重新整理UI

解決辦法:

參考:CocoaChina
dispatch_async(dispatch_get_main_queue(), ^
            {
                // 更UI

            });
           

或者

[self performSelectorOnMainThread:<#(nonnull SEL)#> withObject:<#(nullable id)#> waitUntilDone:<#(BOOL)#>]

           
參見:Stack Overflow
This application is modifying the autolayout engine from a background thread, which can lead

其他類似:

(http://blog.csdn.net/quanqinyang/article/details/49516593)

繼續閱讀