且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

获得一个"此应用程序修改自动布局引擎"错误?

更新时间:2022-02-14 22:44:25

好吧 - 找到了答案。它需要被放置在不同的线程,使UI更新里面的:

Okay - found the answer. It needs to be placed inside a different thread that allows the UI to update:

dispatch_async(dispatch_get_main_queue(), {
    // code here
})

的Objective-C版本

dispatch_async(dispatch_get_main_queue(), ^{
    // code here
});