美文网首页
This application is modifying th

This application is modifying th

作者: a_mean | 来源:发表于2015-11-26 12:49 被阅读211次

    升级iOS9.1、xcode7.1后,

    iOS也有类似android4.0之后在子线程中不能更新UI的规定了,

    如果在后台线程中操作UI的话,

    会提示如下错误:

    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的代码放进dispatch_async中进行调用:

    dispatch_async(dispatch_get_main_queue(), {

    //更新ui

    })

    相关文章

      网友评论

          本文标题:This application is modifying th

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