美文网首页iOS错误&解决
Modifications to the layout engi

Modifications to the layout engi

作者: 燃_火 | 来源:发表于2021-03-24 09:21 被阅读0次

    主线程刷新UI崩溃问题,Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.大概意思是:不能在后台线程中改变UI布局,必须在主线程中执行。
    解决方法:添加同步执行

    dispatch_sync(dispatch_get_main_queue(), ^{
        //刷新UI的代码放到主线程执行
    });
    

    相关文章

      网友评论

        本文标题:Modifications to the layout engi

        本文链接:https://www.haomeiwen.com/subject/mowkzktx.html