項目中遇到一個跳轉問題,延時(等待時間)特别久,并且報下面的的提示警告
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.
問題原因:
問題的原因是因為在子線程中重新整理了UI,解決辦法是,回到主線程中重新整理UI
解決辦法:
參考:CocoaChina
dispatch_async(dispatch_get_main_queue(), ^
{
// 更UI
});
或者
[self performSelectorOnMainThread:<#(nonnull SEL)#> withObject:<#(nullable id)#> waitUntilDone:<#(BOOL)#>]
參見:Stack Overflow
其他類似:
(http://blog.csdn.net/quanqinyang/article/details/49516593)